mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 11:35:04 +01:00
always reevaluate remote media when receiving a new remote track
not just when we don't know the stream already this caused the video track to not appear when the other party sends the invite. Also added more logging
This commit is contained in:
parent
230ccd95ab
commit
be04eeded0
@ -902,6 +902,9 @@ export class PeerCall implements IDisposable {
|
||||
|
||||
|
||||
private onRemoteTrack(track: Track, streams: ReadonlyArray<Stream>, log: ILogItem) {
|
||||
log.set("kind", track.kind);
|
||||
log.set("id", track.id);
|
||||
log.set("streams", streams.map(s => s.id));
|
||||
if (streams.length === 0) {
|
||||
log.log({l: `ignoring ${track.kind} streamless track`, id: track.id});
|
||||
return;
|
||||
@ -932,11 +935,12 @@ export class PeerCall implements IDisposable {
|
||||
disposeListener,
|
||||
stream
|
||||
});
|
||||
this.updateRemoteMedia(log);
|
||||
}
|
||||
this.updateRemoteMedia(log);
|
||||
}
|
||||
|
||||
private updateRemoteMedia(log: ILogItem): void {
|
||||
log.wrap("reevaluating remote media", log => {
|
||||
this._remoteMedia.userMedia = undefined;
|
||||
this._remoteMedia.screenShare = undefined;
|
||||
if (this.remoteSDPStreamMetadata) {
|
||||
@ -958,13 +962,22 @@ export class PeerCall implements IDisposable {
|
||||
metaData.audio_muted || !audioReceiver?.track,
|
||||
metaData.video_muted || !videoReceiver?.track
|
||||
);
|
||||
log.log({
|
||||
l: "setting userMedia",
|
||||
micMuted: this._remoteMuteSettings.microphone,
|
||||
cameraMuted: this._remoteMuteSettings.camera
|
||||
});
|
||||
} else if (metaData.purpose === SDPStreamMetadataPurpose.Screenshare) {
|
||||
this._remoteMedia.screenShare = stream;
|
||||
log.log("setting screenShare");
|
||||
}
|
||||
} else {
|
||||
log.log({l: "no metadata yet for stream, ignoring for now", id: stream.id});
|
||||
}
|
||||
}
|
||||
}
|
||||
this.options.emitUpdate(this, undefined);
|
||||
});
|
||||
}
|
||||
|
||||
private updateLocalMedia(localMedia: LocalMedia, logItem: ILogItem): Promise<void> {
|
||||
|
Loading…
Reference in New Issue
Block a user