You've already forked matrix-js-sdk
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:
@@ -61,7 +61,7 @@ export class CallFeed extends EventEmitter {
|
|||||||
* @returns {boolean} is audio muted?
|
* @returns {boolean} is audio muted?
|
||||||
*/
|
*/
|
||||||
public isAudioMuted(): boolean {
|
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 {
|
public isVideoMuted(): boolean {
|
||||||
// We assume only one video track
|
// We assume only one video track
|
||||||
return !this.stream.getTracks().some((track) => track.kind === "video");
|
return this.stream.getVideoTracks().length === 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user