expo-libvlc-player 7.1.0 → 7.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/src/main/java/expo/modules/libvlcplayer/constants/MediaPlayerConstants.kt +1 -0
- package/android/src/main/java/expo/modules/libvlcplayer/managers/PictureInPictureManager.kt +1 -1
- package/expo-module.config.json +4 -4
- package/package.json +4 -6
- package/plugin/build/withExpoLibVlcPlayer.js +13 -13
- package/plugin/src/withExpoLibVlcPlayer.ts +15 -15
|
@@ -15,6 +15,7 @@ object MediaPlayerConstants {
|
|
|
15
15
|
const val EXTRA_CONTROL_FORWARD: Int = 4
|
|
16
16
|
const val SEEK_STEP_MS: Long = 10_000L
|
|
17
17
|
|
|
18
|
+
const val ATTACH_DELAY_MS: Long = 250L
|
|
18
19
|
const val PAUSE_DELAY_MS: Long = 1_000L
|
|
19
20
|
const val EXP_DELAY_MULTIPLIER: Double = 1.5
|
|
20
21
|
const val RETRY_DELAY_MS: Double = 300.0
|
|
@@ -277,7 +277,7 @@ class PictureInPictureManager(
|
|
|
277
277
|
pipView?.let { view ->
|
|
278
278
|
// Black screen workaround
|
|
279
279
|
view.detachPlayerLayout()
|
|
280
|
-
view.
|
|
280
|
+
view.postDelayed({ view.attachPlayerLayout(pictureLayout) }, MediaPlayerConstants.ATTACH_DELAY_MS)
|
|
281
281
|
}
|
|
282
282
|
}
|
|
283
283
|
|
package/expo-module.config.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
-
"platforms": ["
|
|
3
|
-
"apple": {
|
|
4
|
-
"modules": ["LibVlcPlayerModule"]
|
|
5
|
-
},
|
|
2
|
+
"platforms": ["android", "apple"],
|
|
6
3
|
"android": {
|
|
7
4
|
"modules": ["expo.modules.libvlcplayer.LibVlcPlayerModule"]
|
|
5
|
+
},
|
|
6
|
+
"apple": {
|
|
7
|
+
"modules": ["LibVlcPlayerModule"]
|
|
8
8
|
}
|
|
9
9
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-libvlc-player",
|
|
3
|
-
"version": "7.1.
|
|
3
|
+
"version": "7.1.2",
|
|
4
4
|
"description": "LibVLC Player for Expo",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -8,12 +8,13 @@
|
|
|
8
8
|
"build": "node scripts/build.js",
|
|
9
9
|
"clean": "node scripts/clean.js",
|
|
10
10
|
"lint": "eslint src/",
|
|
11
|
-
"
|
|
11
|
+
"open:android": "node scripts/open-android.js",
|
|
12
12
|
"open:ios": "node scripts/open-ios.js",
|
|
13
|
-
"
|
|
13
|
+
"prepare": "node scripts/prepare.js"
|
|
14
14
|
},
|
|
15
15
|
"keywords": [
|
|
16
16
|
"react-native",
|
|
17
|
+
"vlc",
|
|
17
18
|
"expo",
|
|
18
19
|
"libvlc",
|
|
19
20
|
"player",
|
|
@@ -45,8 +46,5 @@
|
|
|
45
46
|
"expo": "*",
|
|
46
47
|
"react": "*",
|
|
47
48
|
"react-native": "*"
|
|
48
|
-
},
|
|
49
|
-
"allowScripts": {
|
|
50
|
-
"fsevents@2.3.3": true
|
|
51
49
|
}
|
|
52
50
|
}
|
|
@@ -5,6 +5,19 @@ const LOCAL_NETWORK_USAGE = "Allow $(PRODUCT_NAME) to access your local network"
|
|
|
5
5
|
const AUDIO_BACKGROUND_MODE = "audio";
|
|
6
6
|
const PICTURE_CONFIG_MANIFEST = "android:supportsPictureInPicture";
|
|
7
7
|
const withExpoLibVlcPlayer = (config, { localNetworkPermission, supportsPictureInPicture } = {}) => {
|
|
8
|
+
(0, config_plugins_1.withAndroidManifest)(config, (config) => {
|
|
9
|
+
const needsConfigMod = typeof supportsPictureInPicture === "boolean";
|
|
10
|
+
if (needsConfigMod) {
|
|
11
|
+
const activity = config_plugins_1.AndroidConfig.Manifest.getMainActivityOrThrow(config.modResults);
|
|
12
|
+
if (supportsPictureInPicture) {
|
|
13
|
+
activity.$[PICTURE_CONFIG_MANIFEST] = "true";
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
Reflect.deleteProperty(activity.$, PICTURE_CONFIG_MANIFEST);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return config;
|
|
20
|
+
});
|
|
8
21
|
config_plugins_1.IOSConfig.Permissions.createPermissionsPlugin({
|
|
9
22
|
NSLocalNetworkUsageDescription: LOCAL_NETWORK_USAGE,
|
|
10
23
|
})(config, {
|
|
@@ -24,19 +37,6 @@ const withExpoLibVlcPlayer = (config, { localNetworkPermission, supportsPictureI
|
|
|
24
37
|
}
|
|
25
38
|
return config;
|
|
26
39
|
});
|
|
27
|
-
(0, config_plugins_1.withAndroidManifest)(config, (config) => {
|
|
28
|
-
const needsConfigMod = typeof supportsPictureInPicture === "boolean";
|
|
29
|
-
if (needsConfigMod) {
|
|
30
|
-
const activity = config_plugins_1.AndroidConfig.Manifest.getMainActivityOrThrow(config.modResults);
|
|
31
|
-
if (supportsPictureInPicture) {
|
|
32
|
-
activity.$[PICTURE_CONFIG_MANIFEST] = "true";
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
Reflect.deleteProperty(activity.$, PICTURE_CONFIG_MANIFEST);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
return config;
|
|
39
|
-
});
|
|
40
40
|
return config;
|
|
41
41
|
};
|
|
42
42
|
exports.default = withExpoLibVlcPlayer;
|
|
@@ -19,39 +19,39 @@ const withExpoLibVlcPlayer: ConfigPlugin<WithExpoLibVlcPlayerProps> = (
|
|
|
19
19
|
config,
|
|
20
20
|
{ localNetworkPermission, supportsPictureInPicture } = {}
|
|
21
21
|
) => {
|
|
22
|
-
|
|
23
|
-
NSLocalNetworkUsageDescription: LOCAL_NETWORK_USAGE,
|
|
24
|
-
})(config, {
|
|
25
|
-
NSLocalNetworkUsageDescription: localNetworkPermission,
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
withInfoPlist(config, (config) => {
|
|
22
|
+
withAndroidManifest(config, (config) => {
|
|
29
23
|
const needsConfigMod = typeof supportsPictureInPicture === "boolean";
|
|
30
24
|
|
|
31
25
|
if (needsConfigMod) {
|
|
32
|
-
const
|
|
33
|
-
const filteredModes = backgroundModes.filter((mode) => mode !== AUDIO_BACKGROUND_MODE);
|
|
26
|
+
const activity = AndroidConfig.Manifest.getMainActivityOrThrow(config.modResults);
|
|
34
27
|
|
|
35
28
|
if (supportsPictureInPicture) {
|
|
36
|
-
|
|
29
|
+
activity.$[PICTURE_CONFIG_MANIFEST] = "true";
|
|
37
30
|
} else {
|
|
38
|
-
|
|
31
|
+
Reflect.deleteProperty(activity.$, PICTURE_CONFIG_MANIFEST);
|
|
39
32
|
}
|
|
40
33
|
}
|
|
41
34
|
|
|
42
35
|
return config;
|
|
43
36
|
});
|
|
44
37
|
|
|
45
|
-
|
|
38
|
+
IOSConfig.Permissions.createPermissionsPlugin({
|
|
39
|
+
NSLocalNetworkUsageDescription: LOCAL_NETWORK_USAGE,
|
|
40
|
+
})(config, {
|
|
41
|
+
NSLocalNetworkUsageDescription: localNetworkPermission,
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
withInfoPlist(config, (config) => {
|
|
46
45
|
const needsConfigMod = typeof supportsPictureInPicture === "boolean";
|
|
47
46
|
|
|
48
47
|
if (needsConfigMod) {
|
|
49
|
-
const
|
|
48
|
+
const backgroundModes = config.modResults.UIBackgroundModes ?? [];
|
|
49
|
+
const filteredModes = backgroundModes.filter((mode) => mode !== AUDIO_BACKGROUND_MODE);
|
|
50
50
|
|
|
51
51
|
if (supportsPictureInPicture) {
|
|
52
|
-
|
|
52
|
+
config.modResults.UIBackgroundModes = [...filteredModes, AUDIO_BACKGROUND_MODE];
|
|
53
53
|
} else {
|
|
54
|
-
|
|
54
|
+
config.modResults.UIBackgroundModes = filteredModes;
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
|