From 5077a33fcb6ab4ad39505e7475679b4c3b4e9188 Mon Sep 17 00:00:00 2001 From: Hristo Terezov Date: Wed, 7 Dec 2022 15:37:12 -0600 Subject: [PATCH] ref(setVideoMuted): remove mediaType param. --- react/features/base/media/actions.ts | 3 --- react/features/base/media/middleware.any.js | 4 ++-- react/features/base/tracks/actions.native.ts | 9 +++------ react/features/base/tracks/middleware.any.ts | 2 +- react/features/toolbox/actions.any.ts | 3 +-- react/features/video-layout/middleware.native.ts | 4 ++-- react/features/video-menu/actions.any.ts | 2 +- 7 files changed, 10 insertions(+), 17 deletions(-) diff --git a/react/features/base/media/actions.ts b/react/features/base/media/actions.ts index 7c5397b33..a4824f815 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 22364bbaa..056249369 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 ee2628be9..b24e58757 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 26dbe3931..c706323f2 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 98e76d1ff..43882b08e 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 495d91006..36e0795b1 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 0859b4d78..76d556623 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'