fix(conference) fix Spot wireless screen sharing

Make sure we use the same screen-sharing flow which takes multi-stream
into consideration.
This commit is contained in:
Saúl Ibarra Corretgé 2022-10-11 11:52:55 +02:00 committed by Saúl Ibarra Corretgé
parent 6c3206e4d4
commit e218c0d3af
2 changed files with 35 additions and 19 deletions

View File

@ -127,6 +127,7 @@ import {
isLocalTrackMuted,
isUserInteractionRequiredForUnmute,
replaceLocalTrack,
toggleScreensharing as toggleScreensharingA,
trackAdded,
trackRemoved
} from './react/features/base/tracks';
@ -1733,6 +1734,8 @@ export default {
* is not specified and starts the procedure for obtaining new screen
* sharing/video track otherwise.
*
* NOTE: this is currently ONLY used in the non-multi-stream case.
*
* @param {boolean} [toggle] - If true - new screen sharing track will be
* obtained. If false - new video track will be obtain. If not specified -
* toggles between screen sharing and camera video.
@ -2658,9 +2661,14 @@ export default {
}
});
// Used in non-multi-stream.
APP.UI.addListener(
UIEvents.TOGGLE_SCREENSHARING, ({ enabled, audioOnly, ignoreDidHaveVideo }) => {
this.toggleScreenSharing(enabled, { audioOnly }, ignoreDidHaveVideo);
UIEvents.TOGGLE_SCREENSHARING, ({ enabled, audioOnly, ignoreDidHaveVideo, desktopStream }) => {
this.toggleScreenSharing(enabled,
{
audioOnly,
desktopStream
}, ignoreDidHaveVideo);
}
);
},
@ -3216,7 +3224,7 @@ export default {
return;
}
this.toggleScreenSharing(undefined, { desktopStream });
APP.store.dispatch(toggleScreensharingA(undefined, false, false, { desktopStream }));
}
});
}

View File

@ -81,7 +81,7 @@ MiddlewareRegistry.register(store => next => action => {
return;
}
const { enabled, audioOnly, ignoreDidHaveVideo } = action;
const { enabled, audioOnly, ignoreDidHaveVideo, shareOptions } = action;
if (getMultipleVideoSendingSupportFeatureFlag(store.getState())) {
_toggleScreenSharing(action, store);
@ -90,7 +90,8 @@ MiddlewareRegistry.register(store => next => action => {
{
enabled,
audioOnly,
ignoreDidHaveVideo
ignoreDidHaveVideo,
desktopStream: shareOptions?.desktopStream
});
}
}
@ -186,6 +187,11 @@ async function _toggleScreenSharing({ enabled, audioOnly = false, shareOptions =
if (enable) {
let tracks;
// Spot proxy stream.
if (shareOptions.desktopStream) {
tracks = [ shareOptions.desktopStream ];
} else {
const { _desktopSharingSourceDevice } = state['features/base/config'];
if (!shareOptions.desktopSharingSources && _desktopSharingSourceDevice) {
@ -203,6 +209,8 @@ async function _toggleScreenSharing({ enabled, audioOnly = false, shareOptions =
return;
}
}
const desktopAudioTrack = tracks.find(track => track.getType() === MEDIA_TYPE.AUDIO);
const desktopVideoTrack = tracks.find(track => track.getType() === MEDIA_TYPE.VIDEO);