feat(ios) add ability to go PiP while screen sharing

This commit is contained in:
Alexey Matveev 2022-11-08 18:25:36 +03:00 committed by GitHub
parent 84fc4dd63f
commit 30f3bac217
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 3 deletions

View File

@ -160,6 +160,12 @@ export const OVERFLOW_MENU_ENABLED = 'overflow-menu.enabled';
*/ */
export const PIP_ENABLED = 'pip.enabled'; export const PIP_ENABLED = 'pip.enabled';
/**
* Flag indicating if Picture-in-Picture button should be shown while screen sharing.
* Default: disabled (false).
*/
export const PIP_WHILE_SCREEN_SHARING_ENABLED = 'pip-while-screen-sharing.enabled';
/** /**
* Flag indicating if the prejoin page should be enabled. * Flag indicating if the prejoin page should be enabled.
* Default: enabled (true). * Default: enabled (true).

View File

@ -2,7 +2,7 @@
import { NativeModules, Platform } from 'react-native'; import { NativeModules, Platform } from 'react-native';
import { PIP_ENABLED, getFeatureFlag } from '../../../base/flags'; import { PIP_ENABLED, PIP_WHILE_SCREEN_SHARING_ENABLED, getFeatureFlag } from '../../../base/flags';
import { translate } from '../../../base/i18n'; import { translate } from '../../../base/i18n';
import { IconArrowDown } from '../../../base/icons'; import { IconArrowDown } from '../../../base/icons';
import { connect } from '../../../base/redux'; import { connect } from '../../../base/redux';
@ -63,8 +63,10 @@ class PictureInPictureButton extends AbstractButton<Props, *> {
* }} * }}
*/ */
function _mapStateToProps(state): Object { function _mapStateToProps(state): Object {
const flag = Boolean(getFeatureFlag(state, PIP_ENABLED)); const pipEnabled = Boolean(getFeatureFlag(state, PIP_ENABLED));
let enabled = flag && !isLocalVideoTrackDesktop(state); const pipWhileScreenSharingEnabled = getFeatureFlag(state, PIP_WHILE_SCREEN_SHARING_ENABLED, false);
let enabled = pipEnabled && (!isLocalVideoTrackDesktop(state) || pipWhileScreenSharingEnabled);
// Override flag for Android, since it might be unsupported. // Override flag for Android, since it might be unsupported.
if (Platform.OS === 'android' && !NativeModules.PictureInPicture.SUPPORTED) { if (Platform.OS === 'android' && !NativeModules.PictureInPicture.SUPPORTED) {