feat(rn,screen-sharing) allow sharing the screen and camera on mobile (#15236)

* feat(rn,screen-sharing) allow sharing the screen and camera on mobile

With the advancements in layer suspension it should now be ok to do.
Users can still mute the camera themselves if they so desire.

Having the camera enabled while in the background is a separate effort.
This commit is contained in:
Saúl Ibarra Corretgé
2024-10-30 14:11:09 +01:00
committed by GitHub
parent b2059060fc
commit 3fb968b3cb
3 changed files with 5 additions and 14 deletions

View File

@@ -56,8 +56,7 @@ export const VIDEO_MUTISM_AUTHORITY = {
AUDIO_ONLY: 1 << 0,
BACKGROUND: 1 << 1,
USER: 1 << 2,
CAR_MODE: 1 << 3,
SCREEN_SHARE: 1 << 4
CAR_MODE: 1 << 3
};
/* eslint-enable no-bitwise */

View File

@@ -5,11 +5,7 @@ import { NOTIFICATION_TIMEOUT_TYPE } from '../../notifications/constants';
import { PIP_WHILE_SCREEN_SHARING_ENABLED } from '../flags/constants';
import { getFeatureFlag } from '../flags/functions';
import JitsiMeetJS from '../lib-jitsi-meet';
import {
setScreenshareMuted,
setVideoMuted
} from '../media/actions';
import { VIDEO_MUTISM_AUTHORITY } from '../media/constants';
import { setScreenshareMuted } from '../media/actions';
import { addLocalTrack, replaceLocalTrack } from './actions.any';
import { getLocalDesktopTrack, getTrackState, isLocalVideoTrackDesktop } from './functions.native';
@@ -37,7 +33,6 @@ export function toggleScreensharing(enabled: boolean, _ignore1?: boolean, _ignor
}
} else {
dispatch(setScreenshareMuted(true));
dispatch(setVideoMuted(false, VIDEO_MUTISM_AUTHORITY.SCREEN_SHARE));
setPictureInPictureEnabled(true);
}
};
@@ -72,8 +67,6 @@ async function _startScreenSharing(dispatch: IStore['dispatch'], state: IReduxSt
dispatch(addLocalTrack(track));
}
dispatch(setVideoMuted(true, VIDEO_MUTISM_AUTHORITY.SCREEN_SHARE));
const { enabled: audioOnly } = state['features/base/audio-only'];
if (audioOnly) {