add track.

This commit is contained in:
Miroslav Šedivý 2021-11-25 23:47:42 +01:00
parent 4479096a48
commit 18e04fdb03

View File

@ -190,6 +190,14 @@ export class NekoWebRTC extends EventEmitter<NekoWebRTCEvents> {
}
}
public addTrack(track: MediaStreamTrack, ...streams: MediaStream[]): RTCRtpSender {
if (!this._peer) {
throw new Error('attempting to add track for nonexistent peer')
}
return this._peer.addTrack(track, ...streams)
}
public disconnect() {
if (typeof this._channel !== 'undefined') {
// unmount all events