mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 03:25:12 +01:00
Merge pull request #998 from vector-im/bwindels/fix-mic-unmute
fix mic unmute
This commit is contained in:
commit
f4582f19f5
@ -28,22 +28,22 @@ export class LocalMedia {
|
||||
) {}
|
||||
|
||||
withUserMedia(stream: Stream) {
|
||||
return new LocalMedia(stream, this.screenShare, this.dataChannelOptions);
|
||||
return new LocalMedia(stream, this.screenShare?.clone(), this.dataChannelOptions);
|
||||
}
|
||||
|
||||
withScreenShare(stream: Stream) {
|
||||
return new LocalMedia(this.userMedia, stream, this.dataChannelOptions);
|
||||
return new LocalMedia(this.userMedia?.clone(), stream, this.dataChannelOptions);
|
||||
}
|
||||
|
||||
withDataChannel(options: RTCDataChannelInit): LocalMedia {
|
||||
return new LocalMedia(this.userMedia, this.screenShare, options);
|
||||
return new LocalMedia(this.userMedia?.clone(), this.screenShare?.clone(), options);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of LocalMedia without audio track (for user preview)
|
||||
*/
|
||||
asPreview(): LocalMedia {
|
||||
const media = new LocalMedia(this.userMedia, this.screenShare, this.dataChannelOptions);
|
||||
const media = this.clone();
|
||||
const userMedia = media.userMedia;
|
||||
if (userMedia && userMedia.getVideoTracks().length > 0) {
|
||||
const audioTrack = getStreamAudioTrack(userMedia);
|
||||
|
Loading…
Reference in New Issue
Block a user