properly destroy webrtc stream.

This commit is contained in:
Miroslav Šedivý 2020-12-07 18:44:14 +01:00
parent b489432dbe
commit f30614db25

View File

@ -328,8 +328,14 @@
this.webrtc.on('disconnected', () => { this.webrtc.on('disconnected', () => {
Vue.set(this.state.connection, 'webrtc', 'disconnected') Vue.set(this.state.connection, 'webrtc', 'disconnected')
this.events.emit('internal.webrtc', 'disconnected') this.events.emit('internal.webrtc', 'disconnected')
// @ts-ignore
this._video.src = null // destroy stream
if ('srcObject' in this._video) {
this._video.srcObject = null
} else {
// @ts-ignore
this._video.removeAttribute('src')
}
}) })
// hardcoded webrtc for now // hardcoded webrtc for now