-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(screenshare): Audio only screenshare #8922
Merged
andrei-gavrilescu
merged 4 commits into
jitsi:master
from
andrei-gavrilescu:feat/audio-only-screenshare
Apr 12, 2021
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// @flow | ||
|
||
/** | ||
* Type of action which sets the current state of screen audio sharing. | ||
* | ||
* { | ||
* type: SET_SCREEN_AUDIO_SHARE_STATE, | ||
* isSharingAudio: boolean | ||
* } | ||
*/ | ||
export const SET_SCREEN_AUDIO_SHARE_STATE = 'SET_SCREEN_AUDIO_SHARE_STATE'; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// @flow | ||
|
||
import { SET_SCREEN_AUDIO_SHARE_STATE } from './actionTypes'; | ||
|
||
/** | ||
* Updates the current known status of the shared video. | ||
* | ||
* @param {boolean} isSharingAudio - Is audio currently being shared or not. | ||
* @returns {{ | ||
* type: SET_SCREEN_AUDIO_SHARE_STATE, | ||
* isSharingAudio: boolean | ||
* }} | ||
*/ | ||
export function setScreenAudioShareState(isSharingAudio: boolean) { | ||
return { | ||
type: SET_SCREEN_AUDIO_SHARE_STATE, | ||
isSharingAudio | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// @flow | ||
|
||
import { isMacOS } from '../base/environment'; | ||
import { browser } from '../base/lib-jitsi-meet'; | ||
|
||
|
||
/** | ||
* State of audio sharing. | ||
* | ||
* @param {Object} state - The state of the application. | ||
* @returns {boolean} | ||
*/ | ||
export function isScreenAudioShared(state: Object) { | ||
return state['features/screen-share'].isSharingAudio; | ||
} | ||
|
||
/** | ||
* Returns the visibility of the audio only screen share button. Currently electron on mac os doesn't | ||
* have support for this functionality. | ||
* | ||
* @returns {boolean} | ||
*/ | ||
export function isScreenAudioSupported() { | ||
return !(browser.isElectron() && isMacOS()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export * from './actions'; | ||
export * from './actionTypes'; | ||
export * from './functions'; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
import { ReducerRegistry } from '../base/redux'; | ||
|
||
import { SET_SCREEN_AUDIO_SHARE_STATE } from './actionTypes'; | ||
|
||
/** | ||
* Reduces the Redux actions of the feature features/screen-share. | ||
*/ | ||
ReducerRegistry.register('features/screen-share', (state = {}, action) => { | ||
const { isSharingAudio } = action; | ||
|
||
switch (action.type) { | ||
case SET_SCREEN_AUDIO_SHARE_STATE: | ||
return { | ||
...state, | ||
isSharingAudio | ||
}; | ||
|
||
default: | ||
return state; | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to stop screenshare here only when audio-only screenshare is in progress ? If we are using the audio mixer effect and have both video and audio streams from the desktop tracks, any issues with audio track will result in the share being turned off. Is that how we want it to work ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Imo this behaviour is fine. If the user initiates a screen sharing session and goes through the trouble of ticking the Share audio box and there's a problem with that audio track at some point, then the behaviour wouldn't be as expected same as what would happen if something went wrong with the video track.
Of course this is just my point of view, if you feel strongly about it we can think of another way to approach this scenario.