Skip to content

Commit ee4cbd1

Browse files
dbkrrobertlong
authored andcommitted
Don't remove streams that still have tracks (#2104)
If a renogotiation ends up with one track being removed, we removed the whole stream, which would cause us to lose, for example, audio rather than just video.
1 parent 2a0dc39 commit ee4cbd1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/webrtc/call.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -1888,8 +1888,10 @@ export class MatrixCall extends EventEmitter {
18881888
const stream = ev.streams[0];
18891889
this.pushRemoteFeed(stream);
18901890
stream.addEventListener("removetrack", () => {
1891-
logger.log(`Call ${this.callId} removing track streamId: ${stream.id}`);
1892-
this.deleteFeedByStream(stream);
1891+
if (stream.getTracks().length === 0) {
1892+
logger.log(`Call ${this.callId} removing track streamId: ${stream.id}`);
1893+
this.deleteFeedByStream(stream);
1894+
}
18931895
});
18941896
};
18951897

0 commit comments

Comments
 (0)