1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-26 17:03:12 +03:00

Use getAudioTracks() and getVideoTracks()

This is much nicer. Before I hadn't realized this was possible

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
Šimon Brandner
2021-04-05 10:31:27 +02:00
parent 32830b93f1
commit 7f4397f8ca

View File

@@ -61,7 +61,7 @@ export class CallFeed extends EventEmitter {
* @returns {boolean} is audio muted?
*/
public isAudioMuted(): boolean {
return !this.stream.getTracks().some((track) => track.kind === "audio");
return this.stream.getAudioTracks().length === 0;
}
/**
@@ -71,7 +71,7 @@ export class CallFeed extends EventEmitter {
*/
public isVideoMuted(): boolean {
// We assume only one video track
return !this.stream.getTracks().some((track) => track.kind === "video");
return this.stream.getVideoTracks().length === 0;
}
/**