Skip to content
Snippets Groups Projects
Unverified Commit 8e251efe authored by Anton Georgiev's avatar Anton Georgiev Committed by GitHub
Browse files

Merge pull request #11730 from prlanzarin/u23-clcxb

screenshare: check if the user is still presenter after gDM resolves
parents a950c9af 1e199097
No related branches found
No related tags found
No related merge requests found
......@@ -88,6 +88,16 @@ const attachLocalPreviewStream = (mediaElement) => {
}
}
const stopStreamTracks = (stream) => {
if (stream && typeof stream.getTracks === 'function') {
stream.getTracks().forEach(track => {
if (typeof track.stop === 'function') {
track.stop();
}
});
}
}
const screenshareHasStarted = () => {
// Presenter's screen preview is local, so skip
if (!UserListService.amIPresenter()) {
......@@ -105,6 +115,7 @@ const shareScreen = async (onFail) => {
try {
const stream = await BridgeService.getScreenStream();
if(!UserListService.isUserPresenter(Auth.userID)) return stopStreamTracks(stream);
await KurentoBridge.share(stream, onFail);
setSharingScreen(true);
} catch (error) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment