mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-22 19:14:52 +01:00
each LocalMedia own their streams, so a copy should have their own clone
This commit is contained in:
parent
590e9500c1
commit
2bd37970ba
@ -28,15 +28,15 @@ export class LocalMedia {
|
|||||||
) {}
|
) {}
|
||||||
|
|
||||||
withUserMedia(stream: Stream) {
|
withUserMedia(stream: Stream) {
|
||||||
return new LocalMedia(stream, this.screenShare, this.dataChannelOptions);
|
return new LocalMedia(stream, this.screenShare?.clone(), this.dataChannelOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
withScreenShare(stream: Stream) {
|
withScreenShare(stream: Stream) {
|
||||||
return new LocalMedia(this.userMedia, stream, this.dataChannelOptions);
|
return new LocalMedia(this.userMedia?.clone(), stream, this.dataChannelOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
withDataChannel(options: RTCDataChannelInit): LocalMedia {
|
withDataChannel(options: RTCDataChannelInit): LocalMedia {
|
||||||
return new LocalMedia(this.userMedia, this.screenShare, options);
|
return new LocalMedia(this.userMedia?.clone(), this.screenShare?.clone(), options);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user