pip: disable PiP on Android < 26

Fixes: https://github.com/jitsi/jitsi-meet/issues/6008
This commit is contained in:
Saúl Ibarra Corretgé 2020-04-15 09:36:40 +02:00 committed by Saúl Ibarra Corretgé
parent 4824c8714a
commit f9fcb46036
1 changed files with 12 additions and 1 deletions

View File

@ -1,5 +1,7 @@
// @flow
import { Platform } from 'react-native';
import { PIP_ENABLED, getFeatureFlag } from '../../../base/flags';
import { translate } from '../../../base/i18n';
import { IconMenuDown } from '../../../base/icons';
@ -62,8 +64,17 @@ class PictureInPictureButton extends AbstractButton<Props, *> {
* }}
*/
function _mapStateToProps(state): Object {
const flag = Boolean(getFeatureFlag(state, PIP_ENABLED));
let enabled = flag;
// Override flag for Android < 26, PiP was introduced in Oreo.
// https://developer.android.com/guide/topics/ui/picture-in-picture
if (Platform.OS === 'android' && Platform.Version < 26) {
enabled = false;
}
return {
_enabled: Boolean(getFeatureFlag(state, PIP_ENABLED))
_enabled: enabled
};
}