Move screenshare stop logic to ringrtc
Co-authored-by: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com>
This commit is contained in:
parent
df8ee8b13d
commit
511ccb0a60
2 changed files with 3 additions and 16 deletions
|
@ -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);
|
||||||
|
|
|
@ -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,
|
||||||
|
|
Loading…
Reference in a new issue