mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2026-05-14 20:57:47 +00:00
* ref: video muted state Get rid of 'videoMuted' flag in conference.js * ref: audio muted state Get rid of 'audioMuted' flag in conference.js * fix(conference.js|API): early audio/video muted updates * ref(conference.js): rename isVideoMuted Rename isVideoMuted to isLocalVideoMuted to be consistent with isLocalAudioMuted. * doc|style(conference.js): comments and space after if * ref: move 'setTrackMuted' to functions * fix(tracks/middleware): no-lonely-if * ref(features/toolbox): get rid of last argument * ref(defaultToolbarButtons): rename var
31 lines
1022 B
JavaScript
31 lines
1022 B
JavaScript
import { VIDEO_MUTISM_AUTHORITY } from './constants';
|
|
|
|
/**
|
|
* Determines whether a specific videoTrack should be rendered.
|
|
*
|
|
* @param {Track} videoTrack - The video track which is to be rendered.
|
|
* @param {boolean} waitForVideoStarted - True if the specified videoTrack
|
|
* should be rendered only after its associated video has started;
|
|
* otherwise, false.
|
|
* @returns {boolean} True if the specified videoTrack should be renderd;
|
|
* otherwise, false.
|
|
*/
|
|
export function shouldRenderVideoTrack(videoTrack, waitForVideoStarted) {
|
|
return (
|
|
videoTrack
|
|
&& !videoTrack.muted
|
|
&& (!waitForVideoStarted || videoTrack.videoStarted));
|
|
}
|
|
|
|
/**
|
|
* Checks if video is currently muted by the user authority.
|
|
*
|
|
* @param {Object} store - The redux store instance.
|
|
* @returns {boolean}
|
|
*/
|
|
export function isVideoMutedByUser({ getState }) {
|
|
return Boolean(
|
|
getState()['features/base/media'] // eslint-disable-line no-bitwise
|
|
.video.muted & VIDEO_MUTISM_AUTHORITY.USER);
|
|
}
|