Skip to content

Commit

Permalink
feat: multisource support in publisher (#236)
Browse files Browse the repository at this point in the history
Issue:
#147

### Description

In this PR, you can:

- Add new cameras, up to a limit of 4 total (incl. screen shares)
- Add multiple screen shares, up to a limit of 4 total (incl. devices)
- The videos will be displayed in a 1/2/3/4 grid layout
- You can change settings on a per-source basis, incl. name (N.B. name
is only saved locally for now)

### Code changes

- refactored publisher app to use useMultiMediaDevices hook
- refactored state and logic flowin publisher app to support multisource
- enabled adding multiple cameras
- added basic device selector
- updated video settings onto a per-stream basis
- styled grid view format for multiple videos in publisher
  • Loading branch information
jackshen authored Jan 10, 2023
1 parent 1ad9bee commit 87e8075
Show file tree
Hide file tree
Showing 23 changed files with 703 additions and 415 deletions.
1 change: 1 addition & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export const rootMain: StorybookViteConfig = {
resolve: {
alias: {
'@millicast-react/control-bar': path.resolve(__dirname, '../libs/control-bar/src/index.tsx'),
'@millicast-react/device-selection': path.resolve(__dirname, '../libs/device-selection/src/index.ts'),
'@millicast-react/dolbyio-icons': path.resolve(__dirname, '../libs/dolbyio-icons/src/index.ts'),
'@millicast-react/dolbyio-theme': path.resolve(__dirname, '../libs/dolbyio-theme/src/index.ts'),
'@millicast-react/drawer': path.resolve(__dirname, '../libs/drawer/src/index.tsx'),
Expand Down
25 changes: 13 additions & 12 deletions apps/e2e-test/features/publisher-preview.feature
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Feature: Publisher Preview - Not Live
When the publisher clicks on the "add source button"
Then the "share screen button" should be visible
And the "share screen button" should be enabled
And the "add source menu" should contain "Share screen" options
And the "add source menu" should contain "Share screen,Add cameras" options

# Bug/Issue: #200
Scenario: Publisher should be able to share screen before starting the stream
Expand All @@ -89,11 +89,12 @@ Feature: Publisher Preview - Not Live

Then the "screen view" should be displayed
And the "screen view" should be in Normal size
And the "screen view source name" text should be "screen"
And the "screen view source name" text should contain "screen"
And the "screen view setting button" should be displayed
And the "screen view setting button" should be enabled
And the "screen view stop share button" should be displayed
And the "screen view stop share button" should be enabled
# TODO: issue 195
# And the "screen view stop share button" should be displayed
# And the "screen view stop share button" should be enabled
And the "screen view full screen button" should not be displayed

Then the "camera view" should be displayed
Expand All @@ -107,7 +108,6 @@ Feature: Publisher Preview - Not Live
And the "camera view source name" text should contain "fake"
And the "camera view full screen button" should not be displayed

And the "add source button" should not be displayed
# TODO: Bug No #200
# And the "multi source label" should be displayed
# And the "multi source label" text should be "Multisource enabled"
Expand All @@ -118,8 +118,9 @@ Feature: Publisher Preview - Not Live
And the publisher clicks on the "share screen button"
Then the "screen view" should be displayed

When the publisher clicks on the "screen view stop share button"
Then the "screen view" should not be displayed
# TODO: issue 195
# When the publisher clicks on the "screen view stop share button"
# Then the "screen view" should not be displayed

Then the "camera view" should be displayed
And the "camera view" should be in Normal size
Expand All @@ -142,7 +143,7 @@ Feature: Publisher Preview - Not Live
When the publisher clicks on the "camera view setting button"
Then the "camera view settings drawer" should be displayed
Then the "camera view settings drawer title" text should be "Settings"
Then the number of "camera view settings dropdowns" count should be "2"
Then the number of "camera view settings dropdowns" count should be "3"

# TODO: resolution not implemented in setting yet
# Scenario: Publisher should be presented with resolution selection dropdown under settings
Expand Down Expand Up @@ -275,7 +276,6 @@ Feature: Publisher Preview - Not Live
And the "go live button" should be displayed
And the "go live button" should be enabled
And the "go live button" text should be "GO LIVE"
And the "add source button" should not be displayed
And the "invite button" should be displayed
And the "invite button" should be enabled
And the "stream info button" should not be displayed
Expand Down Expand Up @@ -338,9 +338,10 @@ Feature: Publisher Preview - Not Live
And the "screen view" should be in Normal size
And the "screen view setting button" should be displayed
And the "screen view setting button" should be enabled
And the "screen view stop share button" should be displayed
And the "screen view stop share button" should be enabled
And the "screen view source name" text should be "screen"
# TODO: issue 195
# And the "screen view stop share button" should be displayed
# And the "screen view stop share button" should be enabled
And the "screen view source name" text should contain "screen"
And the "screen view full screen button" should not be displayed


Expand Down
Loading

0 comments on commit 87e8075

Please sign in to comment.