mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-14 02:05:39 +00:00
webrtc.js: fix tearing down
This commit is contained in:
parent
fe6267fe0d
commit
7865c31387
1 changed files with 5 additions and 1 deletions
|
@ -60,7 +60,11 @@ function setError(text) {
|
||||||
function resetVideo() {
|
function resetVideo() {
|
||||||
// Release the webcam and mic
|
// Release the webcam and mic
|
||||||
if (local_stream_promise)
|
if (local_stream_promise)
|
||||||
local_stream_promise.then(stream => { stream.stop(); });
|
local_stream_promise.then(stream => {
|
||||||
|
if (stream) {
|
||||||
|
stream.getTracks().forEach(function (track) { track.stop(); });
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// Reset the video element and stop showing the last received frame
|
// Reset the video element and stop showing the last received frame
|
||||||
var videoElement = getVideoElement();
|
var videoElement = getVideoElement();
|
||||||
|
|
Loading…
Reference in a new issue