Bläddra i källkod

fix(pip) make PiP disabled by default

This reverts commit c84c3c61e2.
factor2
Titus Moldovan 3 år sedan
förälder
incheckning
b428ce2dcd

+ 4
- 4
android/sdk/src/main/java/org/jitsi/meet/sdk/PictureInPictureModule.java Visa fil

@@ -43,7 +43,7 @@ class PictureInPictureModule extends ReactContextBaseJavaModule {
43 43
     private static final String TAG = NAME;
44 44
 
45 45
     private static boolean isSupported;
46
-    private boolean isDisabled;
46
+    private boolean isEnabled;
47 47
 
48 48
     public PictureInPictureModule(ReactApplicationContext reactContext) {
49 49
         super(reactContext);
@@ -84,7 +84,7 @@ class PictureInPictureModule extends ReactContextBaseJavaModule {
84 84
      */
85 85
     @TargetApi(Build.VERSION_CODES.O)
86 86
     public void enterPictureInPicture() {
87
-        if (isDisabled) {
87
+        if (!isEnabled) {
88 88
             return;
89 89
         }
90 90
 
@@ -132,8 +132,8 @@ class PictureInPictureModule extends ReactContextBaseJavaModule {
132 132
     }
133 133
 
134 134
     @ReactMethod
135
-    public void setPictureInPictureDisabled(Boolean disabled) {
136
-        this.isDisabled = disabled;
135
+    public void setPictureInPictureEnabled(Boolean enabled) {
136
+        this.isEnabled = enabled;
137 137
     }
138 138
 
139 139
     public boolean isPictureInPictureSupported() {

+ 4
- 4
react/features/base/conference/middleware.native.js Visa fil

@@ -1,6 +1,6 @@
1 1
 // @flow
2 2
 
3
-import { setPictureInPictureDisabled } from '../../mobile/picture-in-picture/functions';
3
+import { setPictureInPictureEnabled } from '../../mobile/picture-in-picture/functions';
4 4
 import { setAudioOnly } from '../audio-only';
5 5
 import JitsiMeetJS from '../lib-jitsi-meet';
6 6
 import { MiddlewareRegistry } from '../redux';
@@ -41,7 +41,7 @@ function _toggleScreenSharing(enabled, store) {
41 41
         }
42 42
     } else {
43 43
         dispatch(destroyLocalDesktopTrackIfExists());
44
-        setPictureInPictureDisabled(false);
44
+        setPictureInPictureEnabled(true);
45 45
     }
46 46
 }
47 47
 
@@ -54,7 +54,7 @@ function _toggleScreenSharing(enabled, store) {
54 54
  * @returns {void}
55 55
  */
56 56
 function _startScreenSharing(dispatch, state) {
57
-    setPictureInPictureDisabled(true);
57
+    setPictureInPictureEnabled(false);
58 58
 
59 59
     JitsiMeetJS.createLocalTracks({ devices: [ 'desktop' ] })
60 60
     .then(tracks => {
@@ -73,6 +73,6 @@ function _startScreenSharing(dispatch, state) {
73 73
     .catch(error => {
74 74
         console.log('ERROR creating ScreeSharing stream ', error);
75 75
 
76
-        setPictureInPictureDisabled(false);
76
+        setPictureInPictureEnabled(true);
77 77
     });
78 78
 }

+ 3
- 0
react/features/conference/components/native/Conference.js Visa fil

@@ -27,6 +27,7 @@ import { getIsLobbyVisible } from '../../../lobby/functions';
27 27
 import { navigate }
28 28
     from '../../../mobile/navigation/components/conference/ConferenceNavigationContainerRef';
29 29
 import { screen } from '../../../mobile/navigation/routes';
30
+import { setPictureInPictureEnabled } from '../../../mobile/picture-in-picture';
30 31
 import { Captions } from '../../../subtitles';
31 32
 import { setToolboxVisible } from '../../../toolbox/actions';
32 33
 import { Toolbox } from '../../../toolbox/components/native';
@@ -179,6 +180,7 @@ class Conference extends AbstractConference<Props, State> {
179 180
      */
180 181
     componentDidMount() {
181 182
         BackHandler.addEventListener('hardwareBackPress', this._onHardwareBackPress);
183
+        setPictureInPictureEnabled(true);
182 184
     }
183 185
 
184 186
     /**
@@ -211,6 +213,7 @@ class Conference extends AbstractConference<Props, State> {
211 213
         BackHandler.removeEventListener('hardwareBackPress', this._onHardwareBackPress);
212 214
 
213 215
         clearTimeout(this._expandedLabelTimeout.current);
216
+        setPictureInPictureEnabled(false);
214 217
     }
215 218
 
216 219
     /**

+ 3
- 3
react/features/conference/components/native/carmode/Conference.tsx Visa fil

@@ -7,7 +7,7 @@ import { useDispatch, useSelector } from 'react-redux';
7 7
 import JitsiScreen from '../../../../base/modal/components/JitsiScreen';
8 8
 import { LoadingIndicator, TintedView } from '../../../../base/react';
9 9
 import { isLocalVideoTrackDesktop } from '../../../../base/tracks';
10
-import { setPictureInPictureDisabled } from '../../../../mobile/picture-in-picture/functions';
10
+import { setPictureInPictureEnabled } from '../../../../mobile/picture-in-picture/functions';
11 11
 import { setIsCarmode } from '../../../../video-layout/actions';
12 12
 import ConferenceTimer from '../../ConferenceTimer';
13 13
 import { isConnecting } from '../../functions';
@@ -31,12 +31,12 @@ const CarmodeTab = (): JSX.Element => {
31 31
 
32 32
     useEffect(() => {
33 33
         dispatch(setIsCarmode(true));
34
-        setPictureInPictureDisabled(true);
34
+        setPictureInPictureEnabled(false);
35 35
 
36 36
         return () => {
37 37
             dispatch(setIsCarmode(false));
38 38
             if (!isSharing) {
39
-                setPictureInPictureDisabled(false);
39
+                setPictureInPictureEnabled(true);
40 40
             }
41 41
         };
42 42
     }, []);

+ 3
- 3
react/features/dropbox/functions.native.js Visa fil

@@ -4,7 +4,7 @@ import { NativeModules } from 'react-native';
4 4
 
5 5
 const { Dropbox } = NativeModules;
6 6
 
7
-import { setPictureInPictureDisabled } from '../mobile/picture-in-picture/functions';
7
+import { setPictureInPictureEnabled } from '../mobile/picture-in-picture/functions';
8 8
 
9 9
 /**
10 10
  * Action to authorize the Jitsi Recording app in dropbox.
@@ -13,12 +13,12 @@ import { setPictureInPictureDisabled } from '../mobile/picture-in-picture/functi
13 13
  * access token or rejected with an error.
14 14
  */
15 15
 export async function _authorizeDropbox(): Promise<Object> {
16
-    setPictureInPictureDisabled(true);
16
+    setPictureInPictureEnabled(false);
17 17
 
18 18
     try {
19 19
         return await Dropbox.authorize();
20 20
     } finally {
21
-        setPictureInPictureDisabled(false);
21
+        setPictureInPictureEnabled(true);
22 22
     }
23 23
 }
24 24
 

+ 3
- 3
react/features/mobile/picture-in-picture/functions.js Visa fil

@@ -5,13 +5,13 @@ import { NativeModules } from 'react-native';
5 5
 /**
6 6
  * Enabled/Disables the PictureInPicture mode in PiP native module.
7 7
  *
8
- * @param {boolean} disabled - Whether the PiP mode should be disabled.
8
+ * @param {boolean} enabled - Whether the PiP mode should be enabled.
9 9
  * @returns {void}
10 10
  */
11
-export function setPictureInPictureDisabled(disabled: boolean) {
11
+export function setPictureInPictureEnabled(enabled: boolean) {
12 12
     const { PictureInPicture } = NativeModules;
13 13
 
14 14
     if (PictureInPicture) {
15
-        PictureInPicture.setPictureInPictureDisabled(disabled);
15
+        PictureInPicture.setPictureInPictureEnabled(enabled);
16 16
     }
17 17
 }

Laddar…
Avbryt
Spara