feat(ios) add ability to go PiP while screen sharing
This commit is contained in:
parent
84fc4dd63f
commit
30f3bac217
|
@ -160,6 +160,12 @@ export const OVERFLOW_MENU_ENABLED = 'overflow-menu.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.
|
||||
* Default: enabled (true).
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
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 { IconArrowDown } from '../../../base/icons';
|
||||
import { connect } from '../../../base/redux';
|
||||
|
@ -63,8 +63,10 @@ class PictureInPictureButton extends AbstractButton<Props, *> {
|
|||
* }}
|
||||
*/
|
||||
function _mapStateToProps(state): Object {
|
||||
const flag = Boolean(getFeatureFlag(state, PIP_ENABLED));
|
||||
let enabled = flag && !isLocalVideoTrackDesktop(state);
|
||||
const pipEnabled = Boolean(getFeatureFlag(state, PIP_ENABLED));
|
||||
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.
|
||||
if (Platform.OS === 'android' && !NativeModules.PictureInPicture.SUPPORTED) {
|
||||
|
|
Loading…
Reference in New Issue