From f62288ae172319818ca9443242b40f0c488978a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Fri, 8 Sep 2017 11:26:54 +0200 Subject: [PATCH] feat(conference): add helper function to check for audio-only muted status --- react/features/base/media/functions.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/react/features/base/media/functions.js b/react/features/base/media/functions.js index cc3d86fa4..f4064ee18 100644 --- a/react/features/base/media/functions.js +++ b/react/features/base/media/functions.js @@ -17,6 +17,18 @@ export function shouldRenderVideoTrack(videoTrack, waitForVideoStarted) { && (!waitForVideoStarted || videoTrack.videoStarted)); } +/** + * Checks if video is currently muted by the audio-only authority. + * + * @param {Object} store - The redux store instance. + * @returns {boolean} + */ +export function isVideoMutedByAudioOnly({ getState }) { + return Boolean( + getState()['features/base/media'] // eslint-disable-line no-bitwise + .video.muted & VIDEO_MUTISM_AUTHORITY.AUDIO_ONLY); +} + /** * Checks if video is currently muted by the user authority. *