1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-28 05:03:59 +03:00

Rename audioOnly to videoMuted

This makes more sense and will match a possible mute events MSC

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
Šimon Brandner
2021-04-04 08:50:27 +02:00
parent cdc0d5623b
commit 32830b93f1

View File

@@ -53,13 +53,23 @@ export class CallFeed extends EventEmitter {
return this.userId === this.client.getUserId(); return this.userId === this.client.getUserId();
} }
// TODO: This should be later replaced by a method // TODO: The two following methods should be later replaced
// that will also check if the remote is muted. // by something that will also check if the remote is muted
/** /**
* Returns true if there are no video tracks, otherwise returns false * Returns true if audio is muted or if there are no audio
* @returns {boolean} is audio only? * tracks, otherwise returns false
* @returns {boolean} is audio muted?
*/ */
public isAudioOnly(): boolean { public isAudioMuted(): boolean {
return !this.stream.getTracks().some((track) => track.kind === "audio");
}
/**
* Returns true video is muted or if there are no video
* tracks, otherwise returns false
* @returns {boolean} is video muted?
*/
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.getTracks().some((track) => track.kind === "video");
} }