Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

ref(setVideoMuted): remove mediaType param.

Hristo Terezov5077a33fcb6a
diff --git a/react/features/base/media/actions.ts b/react/features/base/media/actions.ts
index 7c5397b33d..a4824f8154 100644
--- a/react/features/base/media/actions.ts
+++ b/react/features/base/media/actions.ts
@@ -154,7 +154,6 @@ export function setVideoAvailable(available: boolean) {
*
* @param {boolean} muted - True if the local video is to be muted or false if
* the local video is to be unmuted.
- * @param {MEDIA_TYPE} mediaType - The type of media.
* @param {number} authority - The {@link VIDEO_MUTISM_AUTHORITY} which is
* muting/unmuting the local video.
* @param {boolean} ensureTrack - True if we want to ensure that a new track is
@@ -163,7 +162,6 @@ export function setVideoAvailable(available: boolean) {
*/
export function setVideoMuted(
muted: boolean,
- mediaType: string = MEDIA_TYPE.VIDEO,
authority: number = VIDEO_MUTISM_AUTHORITY.USER,
ensureTrack = false) {
return (dispatch: IStore['dispatch'], getState: IStore['getState']) => {
@@ -186,7 +184,6 @@ export function setVideoMuted(
return dispatch({
type: SET_VIDEO_MUTED,
authority,
- mediaType,
ensureTrack,
muted: newValue
});
diff --git a/react/features/base/media/middleware.any.js b/react/features/base/media/middleware.any.js
index 22364bbaa9..056249369f 100644
--- a/react/features/base/media/middleware.any.js
+++ b/react/features/base/media/middleware.any.js
@@ -166,7 +166,7 @@ function _appStateChanged({ dispatch, getState }, next, action) {
sendAnalytics(createTrackMutedEvent('video', 'background mode', mute));
- dispatch(setVideoMuted(mute, MEDIA_TYPE.VIDEO, VIDEO_MUTISM_AUTHORITY.BACKGROUND));
+ dispatch(setVideoMuted(mute, VIDEO_MUTISM_AUTHORITY.BACKGROUND));
}
return next(action);
@@ -191,7 +191,7 @@ function _setAudioOnly({ dispatch, getState }, next, action) {
sendAnalytics(createTrackMutedEvent('video', 'audio-only mode', audioOnly));
// Make sure we mute both the desktop and video tracks.
- dispatch(setVideoMuted(audioOnly, MEDIA_TYPE.VIDEO, VIDEO_MUTISM_AUTHORITY.AUDIO_ONLY));
+ dispatch(setVideoMuted(audioOnly, VIDEO_MUTISM_AUTHORITY.AUDIO_ONLY));
if (getMultipleVideoSendingSupportFeatureFlag(state)) {
dispatch(setScreenshareMuted(audioOnly, MEDIA_TYPE.SCREENSHARE, SCREENSHARE_MUTISM_AUTHORITY.AUDIO_ONLY));
}
diff --git a/react/features/base/tracks/actions.native.ts b/react/features/base/tracks/actions.native.ts
index ee2628be94..b24e587574 100644
--- a/react/features/base/tracks/actions.native.ts
+++ b/react/features/base/tracks/actions.native.ts
@@ -8,10 +8,7 @@ import {
setScreenshareMuted,
setVideoMuted
} from '../media/actions';
-import {
- MEDIA_TYPE,
- VIDEO_MUTISM_AUTHORITY
-} from '../media/constants';
+import { VIDEO_MUTISM_AUTHORITY } from '../media/constants';
import { addLocalTrack, replaceLocalTrack } from './actions.any';
import { getLocalDesktopTrack, getTrackState, isLocalVideoTrackDesktop } from './functions.native';
@@ -40,7 +37,7 @@ export function toggleScreensharing(enabled: boolean, _ignore1?: boolean, _ignor
}
} else {
dispatch(setScreenshareMuted(true));
- dispatch(setVideoMuted(false, MEDIA_TYPE.VIDEO, VIDEO_MUTISM_AUTHORITY.SCREEN_SHARE));
+ dispatch(setVideoMuted(false, VIDEO_MUTISM_AUTHORITY.SCREEN_SHARE));
setPictureInPictureEnabled(true);
}
};
@@ -73,7 +70,7 @@ async function _startScreenSharing(dispatch: Function, state: IReduxState) {
dispatch(addLocalTrack(track));
}
- dispatch(setVideoMuted(true, MEDIA_TYPE.VIDEO, VIDEO_MUTISM_AUTHORITY.SCREEN_SHARE));
+ dispatch(setVideoMuted(true, VIDEO_MUTISM_AUTHORITY.SCREEN_SHARE));
const { enabled: audioOnly } = state['features/base/audio-only'];
diff --git a/react/features/base/tracks/middleware.any.ts b/react/features/base/tracks/middleware.any.ts
index 26dbe3931e..c706323f2f 100644
--- a/react/features/base/tracks/middleware.any.ts
+++ b/react/features/base/tracks/middleware.any.ts
@@ -88,7 +88,7 @@ MiddlewareRegistry.register(store => next => action => {
return;
}
- _setMuted(store, action, action.mediaType);
+ _setMuted(store, action, MEDIA_TYPE.VIDEO);
break;
case TOGGLE_CAMERA_FACING_MODE: {
diff --git a/react/features/toolbox/actions.any.ts b/react/features/toolbox/actions.any.ts
index 98e76d1ffa..43882b08e7 100644
--- a/react/features/toolbox/actions.any.ts
+++ b/react/features/toolbox/actions.any.ts
@@ -5,7 +5,7 @@ import { sendAnalytics } from '../analytics/functions';
import { IStore } from '../app/types';
import { setAudioOnly } from '../base/audio-only/actions';
import { setVideoMuted } from '../base/media/actions';
-import { MEDIA_TYPE, VIDEO_MUTISM_AUTHORITY } from '../base/media/constants';
+import { VIDEO_MUTISM_AUTHORITY } from '../base/media/constants';
import {
SET_TOOLBOX_ENABLED,
@@ -96,7 +96,6 @@ export function handleToggleVideoMuted(muted: boolean, showUI: boolean, ensureTr
dispatch(
setVideoMuted(
muted,
- MEDIA_TYPE.VIDEO,
VIDEO_MUTISM_AUTHORITY.USER,
ensureTrack));
diff --git a/react/features/video-layout/middleware.native.ts b/react/features/video-layout/middleware.native.ts
index 495d910066..36e0795b1d 100644
--- a/react/features/video-layout/middleware.native.ts
+++ b/react/features/video-layout/middleware.native.ts
@@ -1,5 +1,5 @@
import { setVideoMuted } from '../base/media/actions';
-import { MEDIA_TYPE, VIDEO_MUTISM_AUTHORITY } from '../base/media/constants';
+import { VIDEO_MUTISM_AUTHORITY } from '../base/media/constants';
import MiddlewareRegistry from '../base/redux/MiddlewareRegistry';
import { CLIENT_RESIZED } from '../base/responsive-ui/actionTypes';
import { setLargeVideoDimensions } from '../large-video/actions.any';
@@ -19,7 +19,7 @@ MiddlewareRegistry.register(store => next => action => {
switch (action.type) {
case SET_CAR_MODE:
- dispatch(setVideoMuted(action.enabled, MEDIA_TYPE.VIDEO, VIDEO_MUTISM_AUTHORITY.CAR_MODE));
+ dispatch(setVideoMuted(action.enabled, VIDEO_MUTISM_AUTHORITY.CAR_MODE));
break;
case CLIENT_RESIZED: {
const { clientHeight, clientWidth } = store.getState()['features/base/responsive-ui'];
diff --git a/react/features/video-menu/actions.any.ts b/react/features/video-menu/actions.any.ts
index 0859b4d784..76d5566236 100644
--- a/react/features/video-menu/actions.any.ts
+++ b/react/features/video-menu/actions.any.ts
@@ -52,7 +52,7 @@ export function muteLocal(enable: boolean, mediaType: MediaType, stopScreenShari
sendAnalytics(createToolbarEvent(isAudio ? AUDIO_MUTE : VIDEO_MUTE, { enable }));
dispatch(isAudio ? setAudioMuted(enable, /* ensureTrack */ true)
- : setVideoMuted(enable, mediaType, VIDEO_MUTISM_AUTHORITY.USER, /* ensureTrack */ true));
+ : setVideoMuted(enable, VIDEO_MUTISM_AUTHORITY.USER, /* ensureTrack */ true));
// FIXME: The old conference logic still relies on this event being emitted.
typeof APP === 'undefined'