Move screenshare stop logic to ringrtc
This commit is contained in:
@@ -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,
|
||||||
|
Reference in New Issue
Block a user