mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
sendonly track and remove func.
This commit is contained in:
parent
9be83e5160
commit
fc2979d5ce
@ -211,7 +211,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.addTrack(track, ...streams)
|
return this._peer.addTransceiver(track, { direction: 'sendonly', streams }).sender
|
||||||
|
}
|
||||||
|
|
||||||
|
public removeTrack(sender: RTCRtpSender) {
|
||||||
|
if (!this._peer) {
|
||||||
|
throw new Error('attempting to add track for nonexistent peer')
|
||||||
|
}
|
||||||
|
|
||||||
|
this._peer.removeTrack(sender)
|
||||||
}
|
}
|
||||||
|
|
||||||
public disconnect() {
|
public disconnect() {
|
||||||
|
Loading…
Reference in New Issue
Block a user