mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
chromium webrtc track workaround.
This commit is contained in:
parent
f12d77f78f
commit
88886972e2
@ -235,8 +235,16 @@ export class NekoWebRTC extends EventEmitter<NekoWebRTCEvents> {
|
|||||||
throw new Error('attempting to add track for nonexistent peer')
|
throw new Error('attempting to add track for nonexistent peer')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @ts-ignore
|
||||||
|
const isChromium = !!window.chrome
|
||||||
|
|
||||||
|
// TOOD: Ugly workaround, find real cause of this issue.
|
||||||
|
if (isChromium) {
|
||||||
|
return this._peer.addTrack(track, ...streams)
|
||||||
|
} else {
|
||||||
return this._peer.addTransceiver(track, { direction: 'sendonly', streams }).sender
|
return this._peer.addTransceiver(track, { direction: 'sendonly', streams }).sender
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public removeTrack(sender: RTCRtpSender) {
|
public removeTrack(sender: RTCRtpSender) {
|
||||||
if (!this._peer) {
|
if (!this._peer) {
|
||||||
|
Loading…
Reference in New Issue
Block a user