浏览代码

feat(android) set target SDK to 34 (#14129)

* feat(android) set target SDK to 34 and fixed mediaProjection service type
factor2
Saúl Ibarra Corretgé 1年前
父节点
当前提交
f8cef330f7
没有帐户链接到提交者的电子邮件

+ 6
- 3
android/app/build.gradle 查看文件

15
 android {
15
 android {
16
     compileSdkVersion rootProject.ext.compileSdkVersion
16
     compileSdkVersion rootProject.ext.compileSdkVersion
17
     buildToolsVersion rootProject.ext.buildToolsVersion
17
     buildToolsVersion rootProject.ext.buildToolsVersion
18
-
19
     packagingOptions {
18
     packagingOptions {
20
-        exclude 'lib/*/libhermes*.so'
19
+        jniLibs {
20
+            excludes += ['lib/*/libhermes*.so']
21
+        }
21
     }
22
     }
22
 
23
 
24
+
23
     defaultConfig {
25
     defaultConfig {
24
         applicationId 'org.jitsi.meet'
26
         applicationId 'org.jitsi.meet'
25
         versionCode vcode
27
         versionCode vcode
72
         sourceCompatibility JavaVersion.VERSION_1_8
74
         sourceCompatibility JavaVersion.VERSION_1_8
73
         targetCompatibility JavaVersion.VERSION_1_8
75
         targetCompatibility JavaVersion.VERSION_1_8
74
     }
76
     }
77
+    namespace 'org.jitsi.meet'
75
 }
78
 }
76
 
79
 
77
 dependencies {
80
 dependencies {
78
     implementation 'androidx.appcompat:appcompat:1.5.1'
81
     implementation 'androidx.appcompat:appcompat:1.5.1'
79
 
82
 
80
-    debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.7'
83
+    debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.13'
81
 
84
 
82
     if (!rootProject.ext.libreBuild) {
85
     if (!rootProject.ext.libreBuild) {
83
         // Sync with react-native-google-signin
86
         // Sync with react-native-google-signin

+ 0
- 1
android/app/src/main/AndroidManifest.xml 查看文件

1
 <manifest
1
 <manifest
2
     xmlns:android="http://schemas.android.com/apk/res/android"
2
     xmlns:android="http://schemas.android.com/apk/res/android"
3
-    package="org.jitsi.meet"
4
     android:installLocation="auto">
3
     android:installLocation="auto">
5
   <application
4
   <application
6
       android:allowBackup="true"
5
       android:allowBackup="true"

+ 3
- 3
android/build.gradle 查看文件

10
         mavenCentral()
10
         mavenCentral()
11
     }
11
     }
12
     dependencies {
12
     dependencies {
13
-        classpath 'com.android.tools.build:gradle:7.3.1'
13
+        classpath 'com.android.tools.build:gradle:7.4.2'
14
         classpath 'com.google.gms:google-services:4.4.0'
14
         classpath 'com.google.gms:google-services:4.4.0'
15
         classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.9'
15
         classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.9'
16
     }
16
     }
19
 ext {
19
 ext {
20
     kotlinVersion = "1.7.0"
20
     kotlinVersion = "1.7.0"
21
     buildToolsVersion = "33.0.2"
21
     buildToolsVersion = "33.0.2"
22
-    compileSdkVersion = 33
22
+    compileSdkVersion = 34
23
     minSdkVersion    = 24
23
     minSdkVersion    = 24
24
-    targetSdkVersion = 33
24
+    targetSdkVersion = 34
25
     supportLibVersion = "28.0.0"
25
     supportLibVersion = "28.0.0"
26
 
26
 
27
     // We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP.
27
     // We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP.

+ 1
- 0
android/sdk/build.gradle 查看文件

30
             }
30
             }
31
         }
31
         }
32
     }
32
     }
33
+    namespace 'org.jitsi.meet.sdk'
33
 }
34
 }
34
 
35
 
35
 dependencies {
36
 dependencies {

+ 8
- 3
android/sdk/src/main/AndroidManifest.xml 查看文件

1
 <?xml version="1.0" encoding="utf-8"?>
1
 <?xml version="1.0" encoding="utf-8"?>
2
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
2
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
3
-    xmlns:tools="http://schemas.android.com/tools"
4
-    package="org.jitsi.meet.sdk">
3
+    xmlns:tools="http://schemas.android.com/tools">
5
     <!-- XXX ACCESS_NETWORK_STATE is required by WebRTC. -->
4
     <!-- XXX ACCESS_NETWORK_STATE is required by WebRTC. -->
6
     <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
5
     <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
7
     <uses-permission android:name="android.permission.BLUETOOTH" />
6
     <uses-permission android:name="android.permission.BLUETOOTH" />
13
     <uses-permission android:name="android.permission.WAKE_LOCK" />
12
     <uses-permission android:name="android.permission.WAKE_LOCK" />
14
     <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
13
     <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
15
     <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
14
     <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
15
+    <uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PROJECTION" />
16
+    <uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK" />
16
 
17
 
17
     <uses-feature
18
     <uses-feature
18
         android:glEsVersion="0x00020000"
19
         android:glEsVersion="0x00020000"
48
 
49
 
49
         <service
50
         <service
50
             android:name="org.jitsi.meet.sdk.JitsiMeetOngoingConferenceService"
51
             android:name="org.jitsi.meet.sdk.JitsiMeetOngoingConferenceService"
52
+            android:foregroundServiceType="mediaPlayback" />
53
+
54
+        <service
55
+            android:name="org.jitsi.meet.sdk.JitsiMeetMediaProjectionService"
51
             android:foregroundServiceType="mediaProjection" />
56
             android:foregroundServiceType="mediaProjection" />
52
 
57
 
53
         <provider
58
         <provider
66
 
71
 
67
     </application>
72
     </application>
68
 
73
 
69
-</manifest>
74
+</manifest>

+ 42
- 0
android/sdk/src/main/java/org/jitsi/meet/sdk/JitsiMeetMediaProjectionModule.java 查看文件

1
+package org.jitsi.meet.sdk;
2
+
3
+import android.content.Context;
4
+
5
+import androidx.annotation.NonNull;
6
+
7
+import com.facebook.react.bridge.ReactApplicationContext;
8
+import com.facebook.react.bridge.ReactContextBaseJavaModule;
9
+import com.facebook.react.bridge.ReactMethod;
10
+import com.facebook.react.module.annotations.ReactModule;
11
+
12
+
13
+@ReactModule(name = JitsiMeetMediaProjectionModule.NAME)
14
+class JitsiMeetMediaProjectionModule
15
+    extends ReactContextBaseJavaModule {
16
+
17
+    public static final String NAME = "JitsiMeetMediaProjectionModule";
18
+
19
+    public JitsiMeetMediaProjectionModule(ReactApplicationContext reactContext) {
20
+        super(reactContext);
21
+    }
22
+
23
+    @ReactMethod
24
+    public void launch() {
25
+        Context context = getReactApplicationContext();
26
+
27
+        JitsiMeetMediaProjectionService.launch(context);
28
+    }
29
+
30
+    @ReactMethod
31
+    public void abort() {
32
+        Context context = getReactApplicationContext();
33
+
34
+        JitsiMeetMediaProjectionService.abort(context);
35
+    }
36
+
37
+    @NonNull
38
+    @Override
39
+    public String getName() {
40
+        return NAME;
41
+    }
42
+}

+ 100
- 0
android/sdk/src/main/java/org/jitsi/meet/sdk/JitsiMeetMediaProjectionService.java 查看文件

1
+/*
2
+ * Copyright @ 2019-present 8x8, Inc.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ *     http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+package org.jitsi.meet.sdk;
18
+
19
+
20
+import android.app.Notification;
21
+import android.app.Service;
22
+import android.content.ComponentName;
23
+import android.content.Context;
24
+import android.content.Intent;
25
+import android.content.pm.ServiceInfo;
26
+import android.os.Build;
27
+import android.os.IBinder;
28
+
29
+import org.jitsi.meet.sdk.log.JitsiMeetLogger;
30
+
31
+
32
+/**
33
+ * This class implements an Android {@link Service}, a foreground one specifically, and it's
34
+ * responsible for presenting an ongoing notification when a conference is in progress.
35
+ * The service will help keep the app running while in the background.
36
+ *
37
+ * See: https://developer.android.com/guide/components/services
38
+ */
39
+public class JitsiMeetMediaProjectionService extends Service {
40
+    private static final String TAG = JitsiMeetMediaProjectionService.class.getSimpleName();
41
+
42
+    public static void launch(Context context) {
43
+        OngoingNotification.createOngoingConferenceNotificationChannel();
44
+
45
+        Intent intent = new Intent(context, JitsiMeetMediaProjectionService.class);
46
+
47
+        ComponentName componentName;
48
+
49
+        try {
50
+            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
51
+                componentName = context.startForegroundService(intent);
52
+            } else {
53
+                componentName = context.startService(intent);
54
+            }
55
+        } catch (RuntimeException e) {
56
+            // Avoid crashing due to ForegroundServiceStartNotAllowedException (API level 31).
57
+            // See: https://developer.android.com/guide/components/foreground-services#background-start-restrictions
58
+            JitsiMeetLogger.w(TAG + " Ongoing conference service not started", e);
59
+            return;
60
+        }
61
+
62
+        if (componentName == null) {
63
+            JitsiMeetLogger.w(TAG + " Ongoing conference service not started");
64
+        }
65
+    }
66
+
67
+    public static void abort(Context context) {
68
+        Intent intent = new Intent(context, JitsiMeetMediaProjectionService.class);
69
+        context.stopService(intent);
70
+    }
71
+
72
+    @Override
73
+    public void onCreate() {
74
+        super.onCreate();
75
+
76
+        Notification notification = OngoingNotification.buildOngoingConferenceNotification(null);
77
+
78
+        if (notification == null) {
79
+            stopSelf();
80
+            JitsiMeetLogger.w(TAG + " Couldn't start service, notification is null");
81
+        }
82
+
83
+        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
84
+            startForeground(OngoingNotification.NOTIFICATION_ID, notification, ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PROJECTION);
85
+        } else {
86
+            startForeground(OngoingNotification.NOTIFICATION_ID, notification);
87
+        }
88
+    }
89
+
90
+    @Override
91
+    public IBinder onBind(Intent intent) {
92
+        return null;
93
+    }
94
+
95
+    @Override
96
+    public int onStartCommand(Intent intent, int flags, int startId) {
97
+
98
+        return START_NOT_STICKY;
99
+    }
100
+}

+ 6
- 2
android/sdk/src/main/java/org/jitsi/meet/sdk/JitsiMeetOngoingConferenceService.java 查看文件

23
 import android.content.Context;
23
 import android.content.Context;
24
 import android.content.Intent;
24
 import android.content.Intent;
25
 import android.content.IntentFilter;
25
 import android.content.IntentFilter;
26
+import android.content.pm.ServiceInfo;
26
 import android.os.Build;
27
 import android.os.Build;
27
 import android.os.Bundle;
28
 import android.os.Bundle;
28
 import android.os.IBinder;
29
 import android.os.IBinder;
94
             stopSelf();
95
             stopSelf();
95
             JitsiMeetLogger.w(TAG + " Couldn't start service, notification is null");
96
             JitsiMeetLogger.w(TAG + " Couldn't start service, notification is null");
96
         } else {
97
         } else {
97
-            startForeground(OngoingNotification.NOTIFICATION_ID, notification);
98
-            JitsiMeetLogger.i(TAG + " Service started");
98
+            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
99
+                startForeground(OngoingNotification.NOTIFICATION_ID, notification, ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK);
100
+            } else {
101
+                startForeground(OngoingNotification.NOTIFICATION_ID, notification);
102
+            }
99
         }
103
         }
100
 
104
 
101
         OngoingConferenceTracker.getInstance().addListener(this);
105
         OngoingConferenceTracker.getInstance().addListener(this);

+ 6
- 2
android/sdk/src/main/java/org/jitsi/meet/sdk/OngoingNotification.java 查看文件

73
         notificationManager.createNotificationChannel(channel);
73
         notificationManager.createNotificationChannel(channel);
74
     }
74
     }
75
 
75
 
76
-    static Notification buildOngoingConferenceNotification(boolean isMuted) {
76
+    static Notification buildOngoingConferenceNotification(Boolean isMuted) {
77
         Context context = ReactInstanceManagerHolder.getCurrentActivity();
77
         Context context = ReactInstanceManagerHolder.getCurrentActivity();
78
         if (context == null) {
78
         if (context == null) {
79
             JitsiMeetLogger.w(TAG + " Cannot create notification: no current context");
79
             JitsiMeetLogger.w(TAG + " Cannot create notification: no current context");
92
         builder
92
         builder
93
             .setCategory(NotificationCompat.CATEGORY_CALL)
93
             .setCategory(NotificationCompat.CATEGORY_CALL)
94
             .setContentTitle(context.getString(R.string.ongoing_notification_title))
94
             .setContentTitle(context.getString(R.string.ongoing_notification_title))
95
-            .setContentText(context.getString(R.string.ongoing_notification_text))
95
+            .setContentText(isMuted != null ? context.getString(R.string.ongoing_notification_text) : context.getString(R.string.ongoing_notification_action_screenshare))
96
             .setPriority(NotificationCompat.PRIORITY_DEFAULT)
96
             .setPriority(NotificationCompat.PRIORITY_DEFAULT)
97
             .setContentIntent(pendingIntent)
97
             .setContentIntent(pendingIntent)
98
             .setOngoing(true)
98
             .setOngoing(true)
103
             .setOnlyAlertOnce(true)
103
             .setOnlyAlertOnce(true)
104
             .setSmallIcon(context.getResources().getIdentifier("ic_notification", "drawable", context.getPackageName()));
104
             .setSmallIcon(context.getResources().getIdentifier("ic_notification", "drawable", context.getPackageName()));
105
 
105
 
106
+        if (isMuted == null) {
107
+            return builder.build();
108
+        }
109
+
106
         NotificationCompat.Action hangupAction = createAction(context, JitsiMeetOngoingConferenceService.Action.HANGUP, R.string.ongoing_notification_action_hang_up);
110
         NotificationCompat.Action hangupAction = createAction(context, JitsiMeetOngoingConferenceService.Action.HANGUP, R.string.ongoing_notification_action_hang_up);
107
 
111
 
108
         JitsiMeetOngoingConferenceService.Action toggleAudioAction = isMuted
112
         JitsiMeetOngoingConferenceService.Action toggleAudioAction = isMuted

+ 1
- 0
android/sdk/src/main/java/org/jitsi/meet/sdk/ReactInstanceManagerHolder.java 查看文件

67
                 new DropboxModule(reactContext),
67
                 new DropboxModule(reactContext),
68
                 new ExternalAPIModule(reactContext),
68
                 new ExternalAPIModule(reactContext),
69
                 new JavaScriptSandboxModule(reactContext),
69
                 new JavaScriptSandboxModule(reactContext),
70
+                new JitsiMeetMediaProjectionModule(reactContext),
70
                 new LocaleDetector(reactContext),
71
                 new LocaleDetector(reactContext),
71
                 new LogBridgeModule(reactContext),
72
                 new LogBridgeModule(reactContext),
72
                 new SplashScreenModule(reactContext),
73
                 new SplashScreenModule(reactContext),

+ 1
- 0
android/sdk/src/main/res/values/strings.xml 查看文件

5
     <string name="ongoing_notification_text">You are currently in a meeting. Tap to return to it.</string>
5
     <string name="ongoing_notification_text">You are currently in a meeting. Tap to return to it.</string>
6
     <string name="ongoing_notification_action_hang_up">Hang up</string>
6
     <string name="ongoing_notification_action_hang_up">Hang up</string>
7
     <string name="ongoing_notification_action_mute">Mute</string>
7
     <string name="ongoing_notification_action_mute">Mute</string>
8
+    <string name="ongoing_notification_action_screenshare">You are currently screen-sharing. Tap to return to the meeting.</string>
8
     <string name="ongoing_notification_action_unmute">Unmute</string>
9
     <string name="ongoing_notification_action_unmute">Unmute</string>
9
     <string name="ongoing_notification_channel_name">Ongoing Conference Notifications</string>
10
     <string name="ongoing_notification_channel_name">Ongoing Conference Notifications</string>
10
 </resources>
11
 </resources>

+ 10
- 56
package-lock.json 查看文件

97
         "react-native-svg-transformer": "1.1.0",
97
         "react-native-svg-transformer": "1.1.0",
98
         "react-native-tab-view": "3.5.2",
98
         "react-native-tab-view": "3.5.2",
99
         "react-native-url-polyfill": "2.0.0",
99
         "react-native-url-polyfill": "2.0.0",
100
-        "react-native-video": "6.0.0-alpha.7",
100
+        "react-native-video": "6.0.0-alpha.11",
101
         "react-native-watch-connectivity": "1.1.0",
101
         "react-native-watch-connectivity": "1.1.0",
102
         "react-native-webrtc": "118.0.0",
102
         "react-native-webrtc": "118.0.0",
103
         "react-native-webview": "13.5.1",
103
         "react-native-webview": "13.5.1",
5574
         }
5574
         }
5575
       }
5575
       }
5576
     },
5576
     },
5577
-    "node_modules/@react-native/normalize-color": {
5578
-      "version": "2.1.0",
5579
-      "resolved": "https://registry.npmjs.org/@react-native/normalize-color/-/normalize-color-2.1.0.tgz",
5580
-      "integrity": "sha512-Z1jQI2NpdFJCVgpY+8Dq/Bt3d+YUi1928Q+/CZm/oh66fzM0RUl54vvuXlPJKybH4pdCZey1eDTPaLHkMPNgWA=="
5581
-    },
5582
     "node_modules/@react-native/normalize-colors": {
5577
     "node_modules/@react-native/normalize-colors": {
5583
       "version": "0.72.0",
5578
       "version": "0.72.0",
5584
       "resolved": "https://registry.npmjs.org/@react-native/normalize-colors/-/normalize-colors-0.72.0.tgz",
5579
       "resolved": "https://registry.npmjs.org/@react-native/normalize-colors/-/normalize-colors-0.72.0.tgz",
9335
         "node": ">= 0.6"
9330
         "node": ">= 0.6"
9336
       }
9331
       }
9337
     },
9332
     },
9338
-    "node_modules/deprecated-react-native-prop-types": {
9339
-      "version": "2.3.0",
9340
-      "resolved": "https://registry.npmjs.org/deprecated-react-native-prop-types/-/deprecated-react-native-prop-types-2.3.0.tgz",
9341
-      "integrity": "sha512-pWD0voFtNYxrVqvBMYf5gq3NA2GCpfodS1yNynTPc93AYA/KEMGeWDqqeUB6R2Z9ZofVhks2aeJXiuQqKNpesA==",
9342
-      "dependencies": {
9343
-        "@react-native/normalize-color": "*",
9344
-        "invariant": "*",
9345
-        "prop-types": "*"
9346
-      }
9347
-    },
9348
     "node_modules/destroy": {
9333
     "node_modules/destroy": {
9349
       "version": "1.0.4",
9334
       "version": "1.0.4",
9350
       "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz",
9335
       "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz",
12872
         "rollup": ">= 1.0.0"
12857
         "rollup": ">= 1.0.0"
12873
       }
12858
       }
12874
     },
12859
     },
12875
-    "node_modules/keymirror": {
12876
-      "version": "0.1.1",
12877
-      "resolved": "https://registry.npmjs.org/keymirror/-/keymirror-0.1.1.tgz",
12878
-      "integrity": "sha512-vIkZAFWoDijgQT/Nvl2AHCMmnegN2ehgTPYuyy2hWQkQSntI0S7ESYqdLkoSe1HyEBFHHkCgSIvVdSEiWwKvCg=="
12879
-    },
12880
     "node_modules/kind-of": {
12860
     "node_modules/kind-of": {
12881
       "version": "6.0.3",
12861
       "version": "6.0.3",
12882
       "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz",
12862
       "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz",
16953
       }
16933
       }
16954
     },
16934
     },
16955
     "node_modules/react-native-video": {
16935
     "node_modules/react-native-video": {
16956
-      "version": "6.0.0-alpha.7",
16957
-      "resolved": "https://registry.npmjs.org/react-native-video/-/react-native-video-6.0.0-alpha.7.tgz",
16958
-      "integrity": "sha512-X/siSaJf0V//IbnozjDm1jAjNaXlFy6Hbr6X8GNFl/ztLvN+Z8R/Quq9Q8o22XVwlPacPQ9VS/G0Stdktn0FEw==",
16959
-      "dependencies": {
16960
-        "deprecated-react-native-prop-types": "^2.2.0",
16961
-        "keymirror": "^0.1.1",
16962
-        "prop-types": "^15.7.2"
16936
+      "version": "6.0.0-alpha.11",
16937
+      "resolved": "https://registry.npmjs.org/react-native-video/-/react-native-video-6.0.0-alpha.11.tgz",
16938
+      "integrity": "sha512-Z1FqIkNBqQWdBVKoh5WlmM01LIVhxlOsddKVV9IzMJ3EDl8PAU4ln7hdo85RHCHhgWSHzathPDo0UK7gPB48MA==",
16939
+      "peerDependencies": {
16940
+        "react": "*",
16941
+        "react-native": "*"
16963
       }
16942
       }
16964
     },
16943
     },
16965
     "node_modules/react-native-watch-connectivity": {
16944
     "node_modules/react-native-watch-connectivity": {
23970
         }
23949
         }
23971
       }
23950
       }
23972
     },
23951
     },
23973
-    "@react-native/normalize-color": {
23974
-      "version": "2.1.0",
23975
-      "resolved": "https://registry.npmjs.org/@react-native/normalize-color/-/normalize-color-2.1.0.tgz",
23976
-      "integrity": "sha512-Z1jQI2NpdFJCVgpY+8Dq/Bt3d+YUi1928Q+/CZm/oh66fzM0RUl54vvuXlPJKybH4pdCZey1eDTPaLHkMPNgWA=="
23977
-    },
23978
     "@react-native/normalize-colors": {
23952
     "@react-native/normalize-colors": {
23979
       "version": "0.72.0",
23953
       "version": "0.72.0",
23980
       "resolved": "https://registry.npmjs.org/@react-native/normalize-colors/-/normalize-colors-0.72.0.tgz",
23954
       "resolved": "https://registry.npmjs.org/@react-native/normalize-colors/-/normalize-colors-0.72.0.tgz",
26841
       "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz",
26815
       "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz",
26842
       "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak="
26816
       "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak="
26843
     },
26817
     },
26844
-    "deprecated-react-native-prop-types": {
26845
-      "version": "2.3.0",
26846
-      "resolved": "https://registry.npmjs.org/deprecated-react-native-prop-types/-/deprecated-react-native-prop-types-2.3.0.tgz",
26847
-      "integrity": "sha512-pWD0voFtNYxrVqvBMYf5gq3NA2GCpfodS1yNynTPc93AYA/KEMGeWDqqeUB6R2Z9ZofVhks2aeJXiuQqKNpesA==",
26848
-      "requires": {
26849
-        "@react-native/normalize-color": "*",
26850
-        "invariant": "*",
26851
-        "prop-types": "*"
26852
-      }
26853
-    },
26854
     "destroy": {
26818
     "destroy": {
26855
       "version": "1.0.4",
26819
       "version": "1.0.4",
26856
       "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz",
26820
       "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz",
29474
         "debounce": "^1.2.0"
29438
         "debounce": "^1.2.0"
29475
       }
29439
       }
29476
     },
29440
     },
29477
-    "keymirror": {
29478
-      "version": "0.1.1",
29479
-      "resolved": "https://registry.npmjs.org/keymirror/-/keymirror-0.1.1.tgz",
29480
-      "integrity": "sha512-vIkZAFWoDijgQT/Nvl2AHCMmnegN2ehgTPYuyy2hWQkQSntI0S7ESYqdLkoSe1HyEBFHHkCgSIvVdSEiWwKvCg=="
29481
-    },
29482
     "kind-of": {
29441
     "kind-of": {
29483
       "version": "6.0.3",
29442
       "version": "6.0.3",
29484
       "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz",
29443
       "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz",
32442
       }
32401
       }
32443
     },
32402
     },
32444
     "react-native-video": {
32403
     "react-native-video": {
32445
-      "version": "6.0.0-alpha.7",
32446
-      "resolved": "https://registry.npmjs.org/react-native-video/-/react-native-video-6.0.0-alpha.7.tgz",
32447
-      "integrity": "sha512-X/siSaJf0V//IbnozjDm1jAjNaXlFy6Hbr6X8GNFl/ztLvN+Z8R/Quq9Q8o22XVwlPacPQ9VS/G0Stdktn0FEw==",
32448
-      "requires": {
32449
-        "deprecated-react-native-prop-types": "^2.2.0",
32450
-        "keymirror": "^0.1.1",
32451
-        "prop-types": "^15.7.2"
32452
-      }
32404
+      "version": "6.0.0-alpha.11",
32405
+      "resolved": "https://registry.npmjs.org/react-native-video/-/react-native-video-6.0.0-alpha.11.tgz",
32406
+      "integrity": "sha512-Z1FqIkNBqQWdBVKoh5WlmM01LIVhxlOsddKVV9IzMJ3EDl8PAU4ln7hdo85RHCHhgWSHzathPDo0UK7gPB48MA=="
32453
     },
32407
     },
32454
     "react-native-watch-connectivity": {
32408
     "react-native-watch-connectivity": {
32455
       "version": "1.1.0",
32409
       "version": "1.1.0",

+ 1
- 1
package.json 查看文件

103
     "react-native-svg-transformer": "1.1.0",
103
     "react-native-svg-transformer": "1.1.0",
104
     "react-native-tab-view": "3.5.2",
104
     "react-native-tab-view": "3.5.2",
105
     "react-native-url-polyfill": "2.0.0",
105
     "react-native-url-polyfill": "2.0.0",
106
-    "react-native-video": "6.0.0-alpha.7",
106
+    "react-native-video": "6.0.0-alpha.11",
107
     "react-native-watch-connectivity": "1.1.0",
107
     "react-native-watch-connectivity": "1.1.0",
108
     "react-native-webrtc": "118.0.0",
108
     "react-native-webrtc": "118.0.0",
109
     "react-native-webview": "13.5.1",
109
     "react-native-webview": "13.5.1",

+ 8
- 1
react/features/base/tracks/actions.native.ts 查看文件

1
+import { NativeModules, Platform } from 'react-native';
2
+
1
 import { IReduxState, IStore } from '../../app/types';
3
 import { IReduxState, IStore } from '../../app/types';
2
 import { setPictureInPictureEnabled } from '../../mobile/picture-in-picture/functions';
4
 import { setPictureInPictureEnabled } from '../../mobile/picture-in-picture/functions';
3
 import { showNotification } from '../../notifications/actions';
5
 import { showNotification } from '../../notifications/actions';
12
 import { addLocalTrack, replaceLocalTrack } from './actions.any';
14
 import { addLocalTrack, replaceLocalTrack } from './actions.any';
13
 import { getLocalDesktopTrack, getTrackState, isLocalVideoTrackDesktop } from './functions.native';
15
 import { getLocalDesktopTrack, getTrackState, isLocalVideoTrackDesktop } from './functions.native';
14
 
16
 
17
+const { JitsiMeetMediaProjectionModule } = NativeModules;
18
+
15
 export * from './actions.any';
19
 export * from './actions.any';
16
 
20
 
17
 /**
21
 /**
31
 
35
 
32
             if (!isSharing) {
36
             if (!isSharing) {
33
                 _startScreenSharing(dispatch, state);
37
                 _startScreenSharing(dispatch, state);
38
+                Platform.OS === 'android' && JitsiMeetMediaProjectionModule.launch();
34
             }
39
             }
40
+
41
+            Platform.OS === 'android' && JitsiMeetMediaProjectionModule.abort();
35
         } else {
42
         } else {
36
             dispatch(setScreenshareMuted(true));
43
             dispatch(setScreenshareMuted(true));
37
             dispatch(setVideoMuted(false, VIDEO_MUTISM_AUTHORITY.SCREEN_SHARE));
44
             dispatch(setVideoMuted(false, VIDEO_MUTISM_AUTHORITY.SCREEN_SHARE));
77
             }, NOTIFICATION_TIMEOUT_TYPE.LONG));
84
             }, NOTIFICATION_TIMEOUT_TYPE.LONG));
78
         }
85
         }
79
     } catch (error: any) {
86
     } catch (error: any) {
80
-        console.log('ERROR creating ScreeSharing stream ', error);
87
+        console.log('ERROR creating screen-sharing stream ', error);
81
 
88
 
82
         setPictureInPictureEnabled(true);
89
         setPictureInPictureEnabled(true);
83
     }
90
     }

+ 3
- 1
react/features/shared-video/components/native/VideoManager.tsx 查看文件

19
  * Manager of shared video.
19
  * Manager of shared video.
20
  */
20
  */
21
 class VideoManager extends AbstractVideoManager<IState> {
21
 class VideoManager extends AbstractVideoManager<IState> {
22
-    playerRef: RefObject<Video>;
22
+    playerRef: RefObject<typeof Video>;
23
 
23
 
24
     /**
24
     /**
25
      * Initializes a new VideoManager instance.
25
      * Initializes a new VideoManager instance.
83
      */
83
      */
84
     seek(time: number) {
84
     seek(time: number) {
85
         if (this.player) {
85
         if (this.player) {
86
+
87
+            // @ts-ignore
86
             this.player.seek(time);
88
             this.player.seek(time);
87
         }
89
         }
88
     }
90
     }

正在加载...
取消
保存