diff --git a/bigbluebutton-html5/imports/api/audio/client/bridge/kurento.js b/bigbluebutton-html5/imports/api/audio/client/bridge/kurento.js index 4141f2a6633f03f7ab90c994e1f8d78833aae11d..587a2ae08cc20db302a65ab6cf49076fa20b4894 100755 --- a/bigbluebutton-html5/imports/api/audio/client/bridge/kurento.js +++ b/bigbluebutton-html5/imports/api/audio/client/bridge/kurento.js @@ -277,8 +277,16 @@ export default class KurentoAudioBridge extends BaseAudioBridge { } exitAudio() { + const mediaElement = document.getElementById(MEDIA_TAG); + this.broker.stop(); this.clearReconnectionTimeout(); + + if (mediaElement && typeof mediaElement.pause === 'function') { + mediaElement.pause(); + mediaElement.srcObject = null; + } + return Promise.resolve(); } } diff --git a/bigbluebutton-html5/imports/api/screenshare/client/bridge/kurento.js b/bigbluebutton-html5/imports/api/screenshare/client/bridge/kurento.js index d63005606733887c0c3558f80d594ebdcdcb0520..42ee92cbd5f7d4c77993133f4b9f9549a02b4860 100755 --- a/bigbluebutton-html5/imports/api/screenshare/client/bridge/kurento.js +++ b/bigbluebutton-html5/imports/api/screenshare/client/bridge/kurento.js @@ -283,6 +283,8 @@ export default class KurentoScreenshareBridge { }; stop() { + const mediaElement = document.getElementById(SCREENSHARE_VIDEO_TAG); + if (this.broker) { this.broker.stop(); // Checks if this session is a sharer and if it's not reconnecting @@ -292,6 +294,12 @@ export default class KurentoScreenshareBridge { if (this.broker.role === SEND_ROLE && !this.reconnecting) setSharingScreen(false); this.broker = null; } + + if (mediaElement && typeof mediaElement.pause === 'function') { + mediaElement.pause(); + mediaElement.srcObject = null; + } + this.gdmStream = null; this.clearReconnectionTimeout(); } diff --git a/bigbluebutton-html5/imports/ui/components/video-provider/component.jsx b/bigbluebutton-html5/imports/ui/components/video-provider/component.jsx index 410b992826add6d5905b97c2106081380c1ee359..ba8df05b32cd3d1484dc291e50d10845b3f32ebb 100755 --- a/bigbluebutton-html5/imports/ui/components/video-provider/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/video-provider/component.jsx @@ -787,7 +787,16 @@ class VideoProvider extends Component { } destroyVideoTag(stream) { - delete this.videoTags[stream] + const videoElement = this.videoTags[stream]; + + if (videoElement == null) return; + + if (typeof videoElement.pause === 'function') { + videoElement.pause(); + videoElement.srcObject = null; + } + + delete this.videoTags[stream]; } handlePlayStop(message) {