mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
webrtc set video on track unmute.
This commit is contained in:
parent
c6d4ff25e2
commit
7a7041625a
@ -444,17 +444,24 @@
|
|||||||
const { track, streams } = event
|
const { track, streams } = event
|
||||||
if (track.kind === 'audio') return
|
if (track.kind === 'audio') return
|
||||||
|
|
||||||
// create stream
|
// apply track only once it is unmuted
|
||||||
if ('srcObject' in this._video) {
|
track.addEventListener(
|
||||||
this._video.srcObject = streams[0]
|
'unmute',
|
||||||
} else {
|
() => {
|
||||||
// @ts-ignore
|
// create stream
|
||||||
this._video.src = window.URL.createObjectURL(streams[0]) // for older browsers
|
if ('srcObject' in this._video) {
|
||||||
}
|
this._video.srcObject = streams[0]
|
||||||
|
} else {
|
||||||
|
// @ts-ignore
|
||||||
|
this._video.src = window.URL.createObjectURL(streams[0]) // for older browsers
|
||||||
|
}
|
||||||
|
|
||||||
if (this.autoplay || this.connection.activated) {
|
if (this.autoplay || this.connection.activated) {
|
||||||
this._video.play()
|
this._video.play()
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{ once: true },
|
||||||
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
// unmute on users first interaction
|
// unmute on users first interaction
|
||||||
|
Loading…
Reference in New Issue
Block a user