You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-12-01 04:43:29 +03:00
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.
This commit is contained in:
@@ -1717,7 +1717,12 @@ export class MatrixCall extends EventEmitter {
|
||||
|
||||
const stream = ev.streams[0];
|
||||
this.pushRemoteFeed(stream);
|
||||
stream.addEventListener("removetrack", () => this.deleteFeedByStream(stream));
|
||||
stream.addEventListener("removetrack", () => {
|
||||
if (stream.getTracks().length === 0) {
|
||||
logger.info(`Stream ID ${stream.id} has no tracks remaining - removing`);
|
||||
this.deleteFeedByStream(stream);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
private onDataChannel = (ev: RTCDataChannelEvent): void => {
|
||||
|
||||
Reference in New Issue
Block a user