Skip to content
Snippets Groups Projects
Commit e20fe6d4 authored by prlanzarin's avatar prlanzarin
Browse files

fix(screenshare): avoid leaving a dangling HTMLMediaElement in paused state

parent 8b48de56
No related branches found
No related tags found
No related merge requests found
...@@ -283,6 +283,8 @@ export default class KurentoScreenshareBridge { ...@@ -283,6 +283,8 @@ export default class KurentoScreenshareBridge {
}; };
stop() { stop() {
const mediaElement = document.getElementById(SCREENSHARE_VIDEO_TAG);
if (this.broker) { if (this.broker) {
this.broker.stop(); this.broker.stop();
// Checks if this session is a sharer and if it's not reconnecting // Checks if this session is a sharer and if it's not reconnecting
...@@ -292,6 +294,12 @@ export default class KurentoScreenshareBridge { ...@@ -292,6 +294,12 @@ export default class KurentoScreenshareBridge {
if (this.broker.role === SEND_ROLE && !this.reconnecting) setSharingScreen(false); if (this.broker.role === SEND_ROLE && !this.reconnecting) setSharingScreen(false);
this.broker = null; this.broker = null;
} }
if (mediaElement && typeof mediaElement.pause === 'function') {
mediaElement.pause();
mediaElement.srcObject = null;
}
this.gdmStream = null; this.gdmStream = null;
this.clearReconnectionTimeout(); this.clearReconnectionTimeout();
} }
......
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