Move screenshare stop logic to ringrtc

Co-authored-by: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com>
This commit is contained in:
automated-signal 2024-10-15 14:37:27 -05:00 committed by GitHub
parent df8ee8b13d
commit 511ccb0a60
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 16 deletions

View file

@ -2071,6 +2071,9 @@ export class CallingClass {
maxHeight: REQUESTED_SCREEN_SHARE_HEIGHT, maxHeight: REQUESTED_SCREEN_SHARE_HEIGHT,
maxWidth: REQUESTED_SCREEN_SHARE_WIDTH, maxWidth: REQUESTED_SCREEN_SHARE_WIDTH,
mediaStream, mediaStream,
onEnded: () => {
this.reduxInterface?.cancelPresenting();
},
}) })
); );
this.setOutgoingVideo(conversationId, true); this.setOutgoingVideo(conversationId, true);

View file

@ -1948,22 +1948,6 @@ function _setPresenting(
callLinkRootKey: rootKey, callLinkRootKey: rootKey,
}); });
if (mediaStream != null) {
// If the screen sharing stream is terminated early - stop screen sharing
mediaStream.getVideoTracks()[0]?.addEventListener(
'ended',
() => {
const currentSource = getPresentingSource(getState());
// Verify that the source didn't change while we were waiting.
if (currentSource === sourceToPresent) {
dispatch(cancelPresenting());
}
},
{ once: true }
);
}
dispatch({ dispatch({
type: SET_PRESENTING, type: SET_PRESENTING,
payload: sourceToPresent, payload: sourceToPresent,