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,7 +235,15 @@ 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')
|
||||||
}
|
}
|
||||||
|
|
||||||
return this._peer.addTransceiver(track, { direction: 'sendonly', streams }).sender
|
// @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
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public removeTrack(sender: RTCRtpSender) {
|
public removeTrack(sender: RTCRtpSender) {
|
||||||
|
Loading…
Reference in New Issue
Block a user