Browse Source

pip: disable PiP on Android < 26

Fixes: https://github.com/jitsi/jitsi-meet/issues/6008
master
Saúl Ibarra Corretgé 5 years ago
parent
commit
f9fcb46036

+ 12
- 1
react/features/mobile/picture-in-picture/components/PictureInPictureButton.js View File

@@ -1,5 +1,7 @@
1 1
 // @flow
2 2
 
3
+import { Platform } from 'react-native';
4
+
3 5
 import { PIP_ENABLED, getFeatureFlag } from '../../../base/flags';
4 6
 import { translate } from '../../../base/i18n';
5 7
 import { IconMenuDown } from '../../../base/icons';
@@ -62,8 +64,17 @@ class PictureInPictureButton extends AbstractButton<Props, *> {
62 64
  * }}
63 65
  */
64 66
 function _mapStateToProps(state): Object {
67
+    const flag = Boolean(getFeatureFlag(state, PIP_ENABLED));
68
+    let enabled = flag;
69
+
70
+    // Override flag for Android < 26, PiP was introduced in Oreo.
71
+    // https://developer.android.com/guide/topics/ui/picture-in-picture
72
+    if (Platform.OS === 'android' && Platform.Version < 26) {
73
+        enabled = false;
74
+    }
75
+
65 76
     return {
66
-        _enabled: Boolean(getFeatureFlag(state, PIP_ENABLED))
77
+        _enabled: enabled
67 78
     };
68 79
 }
69 80
 

Loading…
Cancel
Save