bitmovin-player-react-native 1.8.0 → 1.9.0-alpha.0
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/CHANGELOG.md +0 -27
- package/CONTRIBUTING.md +0 -6
- package/android/build.gradle +3 -3
- package/android/src/main/java/com/bitmovin/player/reactnative/ActivityLifecycleListener.kt +1 -13
- package/android/src/main/java/com/bitmovin/player/reactnative/BitmovinCastManagerModule.kt +10 -1
- package/build/bitmovinCastManager.d.ts +0 -2
- package/build/bitmovinCastManager.d.ts.map +1 -1
- package/build/bitmovinCastManager.js +1 -4
- package/build/bitmovinCastManager.js.map +1 -1
- package/build/components/PlayerView/pictureInPictureAction.d.ts +0 -6
- package/build/components/PlayerView/pictureInPictureAction.d.ts.map +1 -1
- package/build/components/PlayerView/pictureInPictureAction.js +0 -6
- package/build/components/PlayerView/pictureInPictureAction.js.map +1 -1
- package/build/hooks/useProxy.d.ts.map +1 -1
- package/build/hooks/useProxy.js +1 -5
- package/build/hooks/useProxy.js.map +1 -1
- package/build/modules/BitmovinCastManagerModule.d.ts +1 -0
- package/build/modules/BitmovinCastManagerModule.d.ts.map +1 -1
- package/build/modules/BitmovinCastManagerModule.js.map +1 -1
- package/build/styleConfig.d.ts +0 -3
- package/build/styleConfig.d.ts.map +1 -1
- package/build/styleConfig.js +0 -3
- package/build/styleConfig.js.map +1 -1
- package/docs/useProxy-event-filtering.md +30 -0
- package/ios/AppLifecycleDelegate.swift +1 -15
- package/ios/BitmovinCastManagerModule.swift +16 -0
- package/ios/RNBitmovinPlayer.podspec +1 -1
- package/package.json +2 -2
- package/plugin/build/Features.d.ts +0 -5
- package/plugin/build/withBitmovinAndroidConfig.js +3 -21
- package/plugin/build/withBitmovinIosConfig.js +12 -40
- package/plugin/src/Features.ts +1 -10
- package/plugin/src/withBitmovinAndroidConfig.ts +3 -33
- package/plugin/src/withBitmovinIosConfig.ts +12 -39
- package/src/bitmovinCastManager.ts +2 -5
- package/src/components/PlayerView/pictureInPictureAction.ts +0 -6
- package/src/hooks/useProxy.ts +1 -5
- package/src/modules/BitmovinCastManagerModule.ts +1 -0
- package/src/styleConfig.ts +0 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,32 +1,5 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## [1.8.0] - 2026-02-03
|
|
4
|
-
|
|
5
|
-
### Changed
|
|
6
|
-
|
|
7
|
-
- Update Bitmovin's native Android SDK version to `3.140.1+jason`
|
|
8
|
-
- Update Bitmovin's native iOS SDK version to `3.106.0`
|
|
9
|
-
- iOS: `appId` property from Expo config `Features.googleCastSDK.ios` object is now used to initialize Cast receiver application ID
|
|
10
|
-
|
|
11
|
-
### Fixed
|
|
12
|
-
|
|
13
|
-
- Android: Setup of custom `appId` and `messageNamespace` for casting
|
|
14
|
-
|
|
15
|
-
### Added
|
|
16
|
-
|
|
17
|
-
- Android: Expo config `Features.googleCastSDK.android` object properties `appId` and `messageNamespace`
|
|
18
|
-
- iOS: Expo config `Features.googleCastSDK.ios` object property `messageNamespace`
|
|
19
|
-
- Expo config `Features.googleCastSDK` object properties `appId` and `messageNamespace` (in case the Android and iOS properties are the same)
|
|
20
|
-
|
|
21
|
-
## [1.7.0] - 2026-01-15
|
|
22
|
-
|
|
23
|
-
### Changed
|
|
24
|
-
|
|
25
|
-
- Update Bitmovin's native Android SDK version to `3.138.0+jason`
|
|
26
|
-
- Update IMA SDK dependency on Android to `3.38.0`
|
|
27
|
-
- Update Bitmovin's native iOS SDK version to `3.105.0`
|
|
28
|
-
- Update the Google Cast iOS Sender SDK used by the example app to `4.8.4`
|
|
29
|
-
|
|
30
3
|
## [1.6.0] - 2025-12-11
|
|
31
4
|
|
|
32
5
|
### Added
|
package/CONTRIBUTING.md
CHANGED
|
@@ -13,18 +13,12 @@ Before creating a pull request, please
|
|
|
13
13
|
|
|
14
14
|
## Development workflow
|
|
15
15
|
|
|
16
|
-
If this is your first React Native project, setup your React Native development environment for both Android and iOS as described [here](https://reactnative.dev/docs/set-up-your-environment).
|
|
17
|
-
|
|
18
16
|
To get started with the project, run `yarn bootstrap` in the root directory to install the required dependencies for each package and cocoapods dependencies for the example app:
|
|
19
17
|
|
|
20
18
|
```sh
|
|
21
19
|
yarn bootstrap
|
|
22
20
|
```
|
|
23
21
|
|
|
24
|
-
Troubleshooting:
|
|
25
|
-
|
|
26
|
-
- If you see errors such as `xcrun: error: SDK "iphoneos" cannot be located`, switch the previously installed Xcode SDK using `sudo xcode-select -s /Applications/Xcode.app/Contents/Developer` and run `yarn bootstrap` again.
|
|
27
|
-
|
|
28
22
|
> While it's possible to use [`npm`](https://github.com/npm/cli), the tooling is built around [`yarn`](https://classic.yarnpkg.com/), so you'll have an easier time if you use `yarn` for development.
|
|
29
23
|
|
|
30
24
|
While developing, you can run the [example app](/example/) to test your changes. Any changes you make in your library's JavaScript code will be reflected in the example app without a rebuild. If you change any native code, then you'll need to rebuild the example app.
|
package/android/build.gradle
CHANGED
|
@@ -104,10 +104,10 @@ dependencies {
|
|
|
104
104
|
implementation "androidx.concurrent:concurrent-futures-ktx:1.1.0"
|
|
105
105
|
|
|
106
106
|
// Google IMA
|
|
107
|
-
implementation 'com.google.ads.interactivemedia.v3:interactivemedia:3.
|
|
107
|
+
implementation 'com.google.ads.interactivemedia.v3:interactivemedia:3.37.0'
|
|
108
108
|
|
|
109
109
|
// Bitmovin
|
|
110
110
|
implementation 'com.google.android.gms:play-services-ads-identifier:18.0.1'
|
|
111
|
-
implementation 'com.bitmovin.player:player:3.
|
|
112
|
-
implementation 'com.bitmovin.player:player-media-session:3.
|
|
111
|
+
implementation 'com.bitmovin.player:player:3.135.0+jason'
|
|
112
|
+
implementation 'com.bitmovin.player:player-media-session:3.135.0+jason'
|
|
113
113
|
}
|
|
@@ -2,10 +2,8 @@ package com.bitmovin.player.reactnative
|
|
|
2
2
|
|
|
3
3
|
import android.app.Activity
|
|
4
4
|
import android.content.Context
|
|
5
|
-
import android.content.pm.PackageManager
|
|
6
5
|
import android.os.Bundle
|
|
7
6
|
import android.util.Log
|
|
8
|
-
import com.bitmovin.player.casting.BitmovinCastManager
|
|
9
7
|
import expo.modules.core.interfaces.ReactActivityLifecycleListener
|
|
10
8
|
import java.util.concurrent.Executors
|
|
11
9
|
|
|
@@ -20,16 +18,6 @@ class ActivityLifecycleListener : ReactActivityLifecycleListener {
|
|
|
20
18
|
return
|
|
21
19
|
}
|
|
22
20
|
|
|
23
|
-
// It is important to initialize the `BitmovinCastManager`
|
|
24
|
-
// before calling the `getSharedInstance`, as this internally calls
|
|
25
|
-
// `BitmovinCastOptionsProvider` via reflection. Which calls the `BitmovinCastManager`
|
|
26
|
-
// and initializes the singleton, if not already done.
|
|
27
|
-
with(context.packageManager.getApplicationInfo(context.packageName, PackageManager.GET_META_DATA)) {
|
|
28
|
-
val applicationId = metaData?.getString("BITMOVIN_CAST_APP_ID")
|
|
29
|
-
val messageNamespace = metaData?.getString("BITMOVIN_CAST_MESSAGE_NAMESPACE")
|
|
30
|
-
BitmovinCastManager.initialize(applicationId, messageNamespace)
|
|
31
|
-
}
|
|
32
|
-
|
|
33
21
|
try {
|
|
34
22
|
val castContextClass = Class.forName("com.google.android.gms.cast.framework.CastContext")
|
|
35
23
|
val getSharedInstanceMethod = castContextClass.getMethod(
|
|
@@ -38,7 +26,7 @@ class ActivityLifecycleListener : ReactActivityLifecycleListener {
|
|
|
38
26
|
java.util.concurrent.Executor::class.java,
|
|
39
27
|
)
|
|
40
28
|
val executor = Executors.newSingleThreadExecutor()
|
|
41
|
-
|
|
29
|
+
|
|
42
30
|
// The method returns a Task<CastContext>, but we don't need to wait for it
|
|
43
31
|
// The initialization will happen asynchronously
|
|
44
32
|
getSharedInstanceMethod.invoke(null, context, executor)
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
package com.bitmovin.player.reactnative
|
|
2
2
|
|
|
3
|
-
import android.util.Log
|
|
4
3
|
import com.bitmovin.player.casting.BitmovinCastManager
|
|
5
4
|
import com.bitmovin.player.reactnative.extensions.getString
|
|
6
5
|
import expo.modules.kotlin.functions.Queues
|
|
@@ -15,6 +14,16 @@ class BitmovinCastManagerModule : Module() {
|
|
|
15
14
|
BitmovinCastManager.isInitialized()
|
|
16
15
|
}
|
|
17
16
|
|
|
17
|
+
AsyncFunction("initializeCastManager") { options: Map<String, Any>? ->
|
|
18
|
+
val applicationId = options?.getString("applicationId")
|
|
19
|
+
val messageNamespace = options?.getString("messageNamespace")
|
|
20
|
+
|
|
21
|
+
BitmovinCastManager.initialize(
|
|
22
|
+
applicationId,
|
|
23
|
+
messageNamespace,
|
|
24
|
+
)
|
|
25
|
+
}.runOnQueue(Queues.MAIN)
|
|
26
|
+
|
|
18
27
|
AsyncFunction("sendMessage") { message: String, messageNamespace: String? ->
|
|
19
28
|
BitmovinCastManager.getInstance().sendMessage(message, messageNamespace)
|
|
20
29
|
}.runOnQueue(Queues.MAIN)
|
|
@@ -36,8 +36,6 @@ export declare const BitmovinCastManager: {
|
|
|
36
36
|
*
|
|
37
37
|
* @param options The options to be used for initializing `BitmovinCastManager`
|
|
38
38
|
* @returns A promise that resolves when the `BitmovinCastManager` was initialized successfully
|
|
39
|
-
*
|
|
40
|
-
* @deprecated This method is deprecated and will be removed in future versions. Please initialize BitmovinCastManager via ExpoConfig or Info.plist on iOS and AndroidManifest.xml on Android.
|
|
41
39
|
*/
|
|
42
40
|
initialize: (options?: BitmovinCastManagerOptions | null) => Promise<void>;
|
|
43
41
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bitmovinCastManager.d.ts","sourceRoot":"","sources":["../src/bitmovinCastManager.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,MAAM,WAAW,0BAA0B;IACzC;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC;AAED;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB;IAC9B;;;OAGG;yBACsB,OAAO,CAAC,OAAO,CAAC;IAOzC
|
|
1
|
+
{"version":3,"file":"bitmovinCastManager.d.ts","sourceRoot":"","sources":["../src/bitmovinCastManager.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,MAAM,WAAW,0BAA0B;IACzC;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC;AAED;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB;IAC9B;;;OAGG;yBACsB,OAAO,CAAC,OAAO,CAAC;IAOzC;;;;;;;;;OASG;2BAEQ,0BAA0B,GAAG,IAAI,KACzC,OAAO,CAAC,IAAI,CAAC;IAShB;;;;;;OAMG;yBACsB,OAAO,CAAC,IAAI,CAAC;IAOtC;;;;;;OAMG;2BACoB,MAAM,qBAAoB,MAAM,GAAG,IAAI;CAS/D,CAAC"}
|
|
@@ -27,15 +27,12 @@ export const BitmovinCastManager = {
|
|
|
27
27
|
*
|
|
28
28
|
* @param options The options to be used for initializing `BitmovinCastManager`
|
|
29
29
|
* @returns A promise that resolves when the `BitmovinCastManager` was initialized successfully
|
|
30
|
-
*
|
|
31
|
-
* @deprecated This method is deprecated and will be removed in future versions. Please initialize BitmovinCastManager via ExpoConfig or Info.plist on iOS and AndroidManifest.xml on Android.
|
|
32
30
|
*/
|
|
33
31
|
initialize: async (options = null) => {
|
|
34
32
|
if (Platform.OS === 'ios' && Platform.isTV) {
|
|
35
33
|
return Promise.resolve();
|
|
36
34
|
}
|
|
37
|
-
|
|
38
|
-
return Promise.resolve();
|
|
35
|
+
return BitmovinCastManagerModule.initializeCastManager(options || undefined);
|
|
39
36
|
},
|
|
40
37
|
/**
|
|
41
38
|
* Must be called in every Android Activity to update the context to the current one.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bitmovinCastManager.js","sourceRoot":"","sources":["../src/bitmovinCastManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,yBAAyB,MAAM,qCAAqC,CAAC;AAmB5E;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC;;;OAGG;IACH,aAAa,EAAE,KAAK,IAAsB,EAAE;QAC1C,IAAI,QAAQ,CAAC,EAAE,KAAK,KAAK,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC;YAC3C,OAAO,KAAK,CAAC;QACf,CAAC;QACD,OAAO,yBAAyB,CAAC,aAAa,EAAE,CAAC;IACnD,CAAC;IAED
|
|
1
|
+
{"version":3,"file":"bitmovinCastManager.js","sourceRoot":"","sources":["../src/bitmovinCastManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,yBAAyB,MAAM,qCAAqC,CAAC;AAmB5E;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC;;;OAGG;IACH,aAAa,EAAE,KAAK,IAAsB,EAAE;QAC1C,IAAI,QAAQ,CAAC,EAAE,KAAK,KAAK,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC;YAC3C,OAAO,KAAK,CAAC;QACf,CAAC;QACD,OAAO,yBAAyB,CAAC,aAAa,EAAE,CAAC;IACnD,CAAC;IAED;;;;;;;;;OASG;IACH,UAAU,EAAE,KAAK,EACf,UAA6C,IAAI,EAClC,EAAE;QACjB,IAAI,QAAQ,CAAC,EAAE,KAAK,KAAK,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC;YAC3C,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;QAC3B,CAAC;QACD,OAAO,yBAAyB,CAAC,qBAAqB,CACpD,OAAO,IAAI,SAAS,CACrB,CAAC;IACJ,CAAC;IAED;;;;;;OAMG;IACH,aAAa,EAAE,KAAK,IAAmB,EAAE;QACvC,IAAI,QAAQ,CAAC,EAAE,KAAK,KAAK,EAAE,CAAC;YAC1B,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;QAC3B,CAAC;QACD,OAAO,yBAAyB,CAAC,aAAa,EAAE,EAAE,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;IAC1E,CAAC;IAED;;;;;;OAMG;IACH,WAAW,EAAE,CAAC,OAAe,EAAE,mBAAkC,IAAI,EAAE,EAAE;QACvE,IAAI,QAAQ,CAAC,EAAE,KAAK,KAAK,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC;YAC3C,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;QAC3B,CAAC;QACD,OAAO,yBAAyB,CAAC,WAAW,CAC1C,OAAO,EACP,gBAAgB,IAAI,SAAS,CAC9B,CAAC;IACJ,CAAC;CACF,CAAC","sourcesContent":["import { Platform } from 'react-native';\nimport BitmovinCastManagerModule from './modules/BitmovinCastManagerModule';\n\n/**\n * The options to be used for initializing `BitmovinCastManager`\n * @platform Android, iOS\n */\nexport interface BitmovinCastManagerOptions {\n /**\n * ID of receiver application.\n * Using `null` value will result in using the default application ID\n */\n applicationId?: string | null;\n /**\n * A custom message namespace to be used for communication between sender and receiver.\n * Using `null` value will result in using the default message namespace\n */\n messageNamespace?: string | null;\n}\n\n/**\n * Singleton providing access to GoogleCast related features.\n * The `BitmovinCastManager` needs to be initialized by calling `BitmovinCastManager.initialize`\n * before `Player` creation to enable casting features.\n *\n * @platform Android, iOS\n */\nexport const BitmovinCastManager = {\n /**\n * Returns whether the `BitmovinCastManager` is initialized.\n * @returns A promise that resolves with a boolean indicating whether the `BitmovinCastManager` is initialized\n */\n isInitialized: async (): Promise<boolean> => {\n if (Platform.OS === 'ios' && Platform.isTV) {\n return false;\n }\n return BitmovinCastManagerModule.isInitialized();\n },\n\n /**\n * Initialize `BitmovinCastManager` based on the provided `BitmovinCastManagerOptions`.\n * This method needs to be called before `Player` creation to enable casting features.\n * If no options are provided, the default options will be used.\n *\n * IMPORTANT: This should only be called when the Google Cast SDK is available in the application.\n *\n * @param options The options to be used for initializing `BitmovinCastManager`\n * @returns A promise that resolves when the `BitmovinCastManager` was initialized successfully\n */\n initialize: async (\n options: BitmovinCastManagerOptions | null = null\n ): Promise<void> => {\n if (Platform.OS === 'ios' && Platform.isTV) {\n return Promise.resolve();\n }\n return BitmovinCastManagerModule.initializeCastManager(\n options || undefined\n );\n },\n\n /**\n * Must be called in every Android Activity to update the context to the current one.\n * Make sure to call this method on every Android Activity switch.\n *\n * @returns A promise that resolves when the context was updated successfully\n * @platform Android\n */\n updateContext: async (): Promise<void> => {\n if (Platform.OS === 'ios') {\n return Promise.resolve();\n }\n return BitmovinCastManagerModule.updateContext?.() || Promise.resolve();\n },\n\n /**\n * Sends the given message to the cast receiver.\n *\n * @param message The message to be sent\n * @param messageNamespace The message namespace to be used, in case of null the default message namespace will be used\n * @returns A promise that resolves when the message was sent successfully\n */\n sendMessage: (message: string, messageNamespace: string | null = null) => {\n if (Platform.OS === 'ios' && Platform.isTV) {\n return Promise.resolve();\n }\n return BitmovinCastManagerModule.sendMessage(\n message,\n messageNamespace || undefined\n );\n },\n};\n"]}
|
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
export declare enum PictureInPictureAction {
|
|
2
2
|
/**
|
|
3
3
|
* Picture in Picture window shows Play/Pause button depending on the player state.
|
|
4
|
-
*
|
|
5
|
-
* @remarks When using the {@link UserInterfaceType.System}, this property is only supported on iOS 17 and above.
|
|
6
|
-
*
|
|
7
|
-
* @platform iOS, Android
|
|
8
4
|
*/
|
|
9
5
|
TogglePlayback = "TogglePlayback",
|
|
10
6
|
/**
|
|
11
7
|
* Picture in Picture window shows seek forward and seek backward buttons.
|
|
12
8
|
* The player seeks by 10s when the buttons are pressed.
|
|
13
|
-
*
|
|
14
|
-
* @platform iOS, Android
|
|
15
9
|
*/
|
|
16
10
|
Seek = "Seek"
|
|
17
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pictureInPictureAction.d.ts","sourceRoot":"","sources":["../../../src/components/PlayerView/pictureInPictureAction.ts"],"names":[],"mappings":"AAAA,oBAAY,sBAAsB;IAChC
|
|
1
|
+
{"version":3,"file":"pictureInPictureAction.d.ts","sourceRoot":"","sources":["../../../src/components/PlayerView/pictureInPictureAction.ts"],"names":[],"mappings":"AAAA,oBAAY,sBAAsB;IAChC;;OAEG;IACH,cAAc,mBAAmB;IACjC;;;OAGG;IACH,IAAI,SAAS;CACd"}
|
|
@@ -2,17 +2,11 @@ export var PictureInPictureAction;
|
|
|
2
2
|
(function (PictureInPictureAction) {
|
|
3
3
|
/**
|
|
4
4
|
* Picture in Picture window shows Play/Pause button depending on the player state.
|
|
5
|
-
*
|
|
6
|
-
* @remarks When using the {@link UserInterfaceType.System}, this property is only supported on iOS 17 and above.
|
|
7
|
-
*
|
|
8
|
-
* @platform iOS, Android
|
|
9
5
|
*/
|
|
10
6
|
PictureInPictureAction["TogglePlayback"] = "TogglePlayback";
|
|
11
7
|
/**
|
|
12
8
|
* Picture in Picture window shows seek forward and seek backward buttons.
|
|
13
9
|
* The player seeks by 10s when the buttons are pressed.
|
|
14
|
-
*
|
|
15
|
-
* @platform iOS, Android
|
|
16
10
|
*/
|
|
17
11
|
PictureInPictureAction["Seek"] = "Seek";
|
|
18
12
|
})(PictureInPictureAction || (PictureInPictureAction = {}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pictureInPictureAction.js","sourceRoot":"","sources":["../../../src/components/PlayerView/pictureInPictureAction.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,
|
|
1
|
+
{"version":3,"file":"pictureInPictureAction.js","sourceRoot":"","sources":["../../../src/components/PlayerView/pictureInPictureAction.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,sBAUX;AAVD,WAAY,sBAAsB;IAChC;;OAEG;IACH,2DAAiC,CAAA;IACjC;;;OAGG;IACH,uCAAa,CAAA;AACf,CAAC,EAVW,sBAAsB,KAAtB,sBAAsB,QAUjC","sourcesContent":["export enum PictureInPictureAction {\n /**\n * Picture in Picture window shows Play/Pause button depending on the player state.\n */\n TogglePlayback = 'TogglePlayback',\n /**\n * Picture in Picture window shows seek forward and seek backward buttons.\n * The player seeks by 10s when the buttons are pressed.\n */\n Seek = 'Seek',\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useProxy.d.ts","sourceRoot":"","sources":["../../src/hooks/useProxy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAe,MAAM,OAAO,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"useProxy.d.ts","sourceRoot":"","sources":["../../src/hooks/useProxy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAe,MAAM,OAAO,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAGlC;;GAEG;AACH,KAAK,QAAQ,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;AAEtC;;GAEG;AACH,KAAK,cAAc,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE;IAAE,WAAW,EAAE,CAAC,CAAA;CAAE,KAAK,IAAI,CAAC;AAE7D;;GAEG;AACH,wBAAgB,QAAQ,CACtB,OAAO,EAAE,SAAS,CAAC,GAAG,CAAC,GACtB,CAAC,CAAC,SAAS,KAAK,EAAE,QAAQ,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,KAAK,cAAc,CAAC,CAAC,CAAC,CAWhE"}
|
package/build/hooks/useProxy.js
CHANGED
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
import { useCallback } from 'react';
|
|
2
|
-
import { findNodeHandle } from 'react-native';
|
|
3
2
|
import { normalizeNonFinite } from '../utils/normalizeNonFinite';
|
|
4
3
|
/**
|
|
5
4
|
* Create a proxy function that unwraps native events.
|
|
6
5
|
*/
|
|
7
6
|
export function useProxy(viewRef) {
|
|
8
7
|
return useCallback((callback) => (event) => {
|
|
9
|
-
|
|
10
|
-
if (eventTargetNodeHandle !== findNodeHandle(viewRef.current)) {
|
|
11
|
-
return;
|
|
12
|
-
}
|
|
8
|
+
// Remove the target field from the event as it's React Native internal metadata
|
|
13
9
|
const { target, ...eventWithoutTarget } = event.nativeEvent;
|
|
14
10
|
const sanitized = normalizeNonFinite(eventWithoutTarget);
|
|
15
11
|
callback?.(sanitized);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useProxy.js","sourceRoot":"","sources":["../../src/hooks/useProxy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,WAAW,EAAE,MAAM,OAAO,CAAC;AAE/C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"useProxy.js","sourceRoot":"","sources":["../../src/hooks/useProxy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,WAAW,EAAE,MAAM,OAAO,CAAC;AAE/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAYjE;;GAEG;AACH,MAAM,UAAU,QAAQ,CACtB,OAAuB;IAEvB,OAAO,WAAW,CAChB,CAAkB,QAAsB,EAAE,EAAE,CAC1C,CAAC,KAAyB,EAAE,EAAE;QAC5B,gFAAgF;QAChF,MAAM,EAAE,MAAM,EAAE,GAAG,kBAAkB,EAAE,GAAG,KAAK,CAAC,WAAkB,CAAC;QACnE,MAAM,SAAS,GAAG,kBAAkB,CAAC,kBAAkB,CAAC,CAAC;QACzD,QAAQ,EAAE,CAAC,SAAc,CAAC,CAAC;IAC7B,CAAC,EACH,CAAC,OAAO,CAAC,CACV,CAAC;AACJ,CAAC","sourcesContent":["import { RefObject, useCallback } from 'react';\nimport { Event } from '../events';\nimport { normalizeNonFinite } from '../utils/normalizeNonFinite';\n\n/**\n * A function that takes a generic event as argument.\n */\ntype Callback<E> = (event: E) => void;\n\n/**\n * A function that takes the synthetic version of a generic event as argument.\n */\ntype NativeCallback<E> = (event: { nativeEvent: E }) => void;\n\n/**\n * Create a proxy function that unwraps native events.\n */\nexport function useProxy(\n viewRef: RefObject<any>\n): <E extends Event>(callback?: Callback<E>) => NativeCallback<E> {\n return useCallback(\n <E extends Event>(callback?: Callback<E>) =>\n (event: { nativeEvent: E }) => {\n // Remove the target field from the event as it's React Native internal metadata\n const { target, ...eventWithoutTarget } = event.nativeEvent as any;\n const sanitized = normalizeNonFinite(eventWithoutTarget);\n callback?.(sanitized as E);\n },\n [viewRef]\n );\n}\n"]}
|
|
@@ -2,6 +2,7 @@ import { NativeModule } from 'expo-modules-core';
|
|
|
2
2
|
export type BitmovinCastManagerModuleEvents = Record<string, any>;
|
|
3
3
|
declare class BitmovinCastManagerModule extends NativeModule<BitmovinCastManagerModuleEvents> {
|
|
4
4
|
isInitialized(): Promise<boolean>;
|
|
5
|
+
initializeCastManager(options?: Record<string, any>): Promise<void>;
|
|
5
6
|
sendMessage(message: string, messageNamespace?: string): Promise<void>;
|
|
6
7
|
updateContext?(): Promise<void>;
|
|
7
8
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BitmovinCastManagerModule.d.ts","sourceRoot":"","sources":["../../src/modules/BitmovinCastManagerModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAuB,MAAM,mBAAmB,CAAC;AAEtE,MAAM,MAAM,+BAA+B,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAElE,OAAO,OAAO,yBAA0B,SAAQ,YAAY,CAAC,+BAA+B,CAAC;IAC3F,aAAa,IAAI,OAAO,CAAC,OAAO,CAAC;IACjC,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,gBAAgB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IACtE,aAAa,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC;CAChC;;AAED,wBAEE"}
|
|
1
|
+
{"version":3,"file":"BitmovinCastManagerModule.d.ts","sourceRoot":"","sources":["../../src/modules/BitmovinCastManagerModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAuB,MAAM,mBAAmB,CAAC;AAEtE,MAAM,MAAM,+BAA+B,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAElE,OAAO,OAAO,yBAA0B,SAAQ,YAAY,CAAC,+BAA+B,CAAC;IAC3F,aAAa,IAAI,OAAO,CAAC,OAAO,CAAC;IACjC,qBAAqB,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IACnE,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,gBAAgB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IACtE,aAAa,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC;CAChC;;AAED,wBAEE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BitmovinCastManagerModule.js","sourceRoot":"","sources":["../../src/modules/BitmovinCastManagerModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"BitmovinCastManagerModule.js","sourceRoot":"","sources":["../../src/modules/BitmovinCastManagerModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAWtE,eAAe,mBAAmB,CAChC,2BAA2B,CAC5B,CAAC","sourcesContent":["import { NativeModule, requireNativeModule } from 'expo-modules-core';\n\nexport type BitmovinCastManagerModuleEvents = Record<string, any>;\n\ndeclare class BitmovinCastManagerModule extends NativeModule<BitmovinCastManagerModuleEvents> {\n isInitialized(): Promise<boolean>;\n initializeCastManager(options?: Record<string, any>): Promise<void>;\n sendMessage(message: string, messageNamespace?: string): Promise<void>;\n updateContext?(): Promise<void>; // Android only\n}\n\nexport default requireNativeModule<BitmovinCastManagerModule>(\n 'BitmovinCastManagerModule'\n);\n"]}
|
package/build/styleConfig.d.ts
CHANGED
|
@@ -105,13 +105,10 @@ export declare enum ScalingMode {
|
|
|
105
105
|
export declare enum UserInterfaceType {
|
|
106
106
|
/**
|
|
107
107
|
* Indicates that Bitmovin's customizable UI should be used.
|
|
108
|
-
*
|
|
109
|
-
* @platform iOS, Android
|
|
110
108
|
*/
|
|
111
109
|
Bitmovin = "Bitmovin",
|
|
112
110
|
/**
|
|
113
111
|
* Indicates that the system UI should be used.
|
|
114
|
-
*
|
|
115
112
|
* @platform iOS, tvOS
|
|
116
113
|
*/
|
|
117
114
|
System = "System",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styleConfig.d.ts","sourceRoot":"","sources":["../src/styleConfig.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B;;;;;;;;;;OAUG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;;;;;;;;;;OAaG;IACH,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC;;;;;;;;;;;OAWG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;;;;;;;OAWG;IACH,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC;;;;;;;;;;;OAWG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;;;;;;;;OAWG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B;AAED;;GAEG;AACH,oBAAY,WAAW;IACrB;;OAEG;IACH,GAAG,QAAQ;IACX;;OAEG;IACH,OAAO,YAAY;IACnB;;OAEG;IACH,IAAI,SAAS;CACd;AAED;;GAEG;AACH,oBAAY,iBAAiB;IAC3B
|
|
1
|
+
{"version":3,"file":"styleConfig.d.ts","sourceRoot":"","sources":["../src/styleConfig.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B;;;;;;;;;;OAUG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;;;;;;;;;;OAaG;IACH,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC;;;;;;;;;;;OAWG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;;;;;;;OAWG;IACH,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC;;;;;;;;;;;OAWG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;;;;;;;;OAWG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B;AAED;;GAEG;AACH,oBAAY,WAAW;IACrB;;OAEG;IACH,GAAG,QAAQ;IACX;;OAEG;IACH,OAAO,YAAY;IACnB;;OAEG;IACH,IAAI,SAAS;CACd;AAED;;GAEG;AACH,oBAAY,iBAAiB;IAC3B;;OAEG;IACH,QAAQ,aAAa;IACrB;;;OAGG;IACH,MAAM,WAAW;IACjB;;OAEG;IACH,QAAQ,aAAa;CACtB"}
|
package/build/styleConfig.js
CHANGED
|
@@ -23,13 +23,10 @@ export var UserInterfaceType;
|
|
|
23
23
|
(function (UserInterfaceType) {
|
|
24
24
|
/**
|
|
25
25
|
* Indicates that Bitmovin's customizable UI should be used.
|
|
26
|
-
*
|
|
27
|
-
* @platform iOS, Android
|
|
28
26
|
*/
|
|
29
27
|
UserInterfaceType["Bitmovin"] = "Bitmovin";
|
|
30
28
|
/**
|
|
31
29
|
* Indicates that the system UI should be used.
|
|
32
|
-
*
|
|
33
30
|
* @platform iOS, tvOS
|
|
34
31
|
*/
|
|
35
32
|
UserInterfaceType["System"] = "System";
|
package/build/styleConfig.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styleConfig.js","sourceRoot":"","sources":["../src/styleConfig.ts"],"names":[],"mappings":"AAqFA;;GAEG;AACH,MAAM,CAAN,IAAY,WAaX;AAbD,WAAY,WAAW;IACrB;;OAEG;IACH,0BAAW,CAAA;IACX;;OAEG;IACH,kCAAmB,CAAA;IACnB;;OAEG;IACH,4BAAa,CAAA;AACf,CAAC,EAbW,WAAW,KAAX,WAAW,QAatB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,
|
|
1
|
+
{"version":3,"file":"styleConfig.js","sourceRoot":"","sources":["../src/styleConfig.ts"],"names":[],"mappings":"AAqFA;;GAEG;AACH,MAAM,CAAN,IAAY,WAaX;AAbD,WAAY,WAAW;IACrB;;OAEG;IACH,0BAAW,CAAA;IACX;;OAEG;IACH,kCAAmB,CAAA;IACnB;;OAEG;IACH,4BAAa,CAAA;AACf,CAAC,EAbW,WAAW,KAAX,WAAW,QAatB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,iBAcX;AAdD,WAAY,iBAAiB;IAC3B;;OAEG;IACH,0CAAqB,CAAA;IACrB;;;OAGG;IACH,sCAAiB,CAAA;IACjB;;OAEG;IACH,0CAAqB,CAAA;AACvB,CAAC,EAdW,iBAAiB,KAAjB,iBAAiB,QAc5B","sourcesContent":["/**\n * Contains config values which can be used to alter the visual presentation and behaviour of the player UI.\n */\nexport interface StyleConfig {\n /**\n * Sets if the UI should be enabled or not. Default value is `true`.\n * @example\n * ```\n * const player = new Player({\n * styleConfig: {\n * isUiEnabled: false,\n * },\n * });\n * ```\n */\n isUiEnabled?: boolean;\n /**\n * Sets which user interface type should be used.\n * Default value is `UserInterfaceType.bitmovin` on `iOS` and `UserInterfaceType.system` on `tvOS`.\n * This setting only applies if `StyleConfig.isUiEnabled` is set to true.\n * @example\n * ```\n * const player = new Player({\n * styleConfig: {\n * userInterfaceType: UserInterfaceType.System,\n * },\n * });\n * ```\n * @platform iOS, tvOS\n */\n userInterfaceType?: UserInterfaceType;\n /**\n * Sets the CSS file that will be used for the UI. The default CSS file will be completely replaced by the CSS file set with this property.\n * @example\n * ```\n * const player = new Player({\n * styleConfig: {\n * playerUiCss: 'https://domain.tld/path/to/bitmovinplayer-ui.css',\n * },\n * });\n * ```\n * @platform iOS, Android\n */\n playerUiCss?: string;\n /**\n * Sets a CSS file which contains supplemental styles for the player UI. These styles will be added to the default CSS file or the CSS file set with `StyleConfig.playerUiCss`.\n * @example\n * ```\n * const player = new Player({\n * styleConfig: {\n * supplementalPlayerUiCss: 'https://domain.tld/path/to/bitmovinplayer-supplemental-ui.css',\n * },\n * });\n * ```\n * @platform iOS, Android\n */\n supplementalPlayerUiCss?: string;\n /**\n * Sets the JS file that will be used for the UI. The default JS file will be completely replaced by the JS file set with this property.\n * @example\n * ```\n * const player = new Player({\n * styleConfig: {\n * playerUiJs: 'https://domain.tld/path/to/bitmovinplayer-ui.js',\n * },\n * });\n * ```\n * @platform iOS, Android\n */\n playerUiJs?: string;\n /**\n * Determines how the video content is scaled or stretched within the parent container’s bounds. Possible values are defined in `ScalingMode`.\n * Default value is `ScalingMode.fit`.\n * @example\n * ```\n * const player = new Player({\n * styleConfig: {\n * scalingMode: ScalingMode.Zoom,\n * },\n * });\n * ```\n */\n scalingMode?: ScalingMode;\n}\n\n/**\n * Specifies how the video content is scaled or stretched.\n */\nexport enum ScalingMode {\n /**\n * Specifies that the player should preserve the video’s aspect ratio and fit the video within the container's bounds.\n */\n Fit = 'Fit',\n /**\n * Specifies that the video should be stretched to fill the container’s bounds. The aspect ratio may not be preserved.\n */\n Stretch = 'Stretch',\n /**\n * Specifies that the player should preserve the video’s aspect ratio and fill the container’s bounds.\n */\n Zoom = 'Zoom',\n}\n\n/**\n * Indicates which type of UI should be used.\n */\nexport enum UserInterfaceType {\n /**\n * Indicates that Bitmovin's customizable UI should be used.\n */\n Bitmovin = 'Bitmovin',\n /**\n * Indicates that the system UI should be used.\n * @platform iOS, tvOS\n */\n System = 'System',\n /**\n * Indicates that only subtitles should be displayed along with the video content.\n */\n Subtitle = 'Subtitle',\n}\n"]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# useProxy native event filtering notes
|
|
2
|
+
|
|
3
|
+
## Why the JS filtering existed originally
|
|
4
|
+
|
|
5
|
+
- React Native synthetic events include a `nativeEvent.target` (view node handle).
|
|
6
|
+
- The original `useProxy` compared the incoming `target` with the current view
|
|
7
|
+
ref to avoid cross-talk when multiple `PlayerView` instances are mounted.
|
|
8
|
+
- This helped multi-player setups where two players emit events at the same time
|
|
9
|
+
and handlers should only fire for the associated view instance.
|
|
10
|
+
|
|
11
|
+
## Why it is being removed now
|
|
12
|
+
|
|
13
|
+
- In some cases `nativeEvent.target` is `undefined`, which causes the filter to
|
|
14
|
+
drop events entirely.
|
|
15
|
+
- Native already scopes events per view in Android, and iOS should be aligned
|
|
16
|
+
(detach old listeners on re-attach) so JS-side target filtering becomes
|
|
17
|
+
redundant.
|
|
18
|
+
|
|
19
|
+
## Current native behavior notes
|
|
20
|
+
|
|
21
|
+
- Android attaches listeners per view and detaches them on swap/dispose.
|
|
22
|
+
- iOS attaches listeners per view but only detaches when `playerId` is `nil`.
|
|
23
|
+
This can allow leaks if a view is re-attached to a different player.
|
|
24
|
+
|
|
25
|
+
## Alternatives to JS target filtering
|
|
26
|
+
|
|
27
|
+
- Include `playerId` in every native event payload and filter in JS by
|
|
28
|
+
`player.nativeId`.
|
|
29
|
+
- Align iOS with Android by detaching old listeners when a different player is
|
|
30
|
+
attached.
|
|
@@ -8,24 +8,10 @@ public class AppLifecycleDelegate: ExpoAppDelegateSubscriber {
|
|
|
8
8
|
) -> Bool {
|
|
9
9
|
// TODO: Add support for OfflineConfig via config plugin
|
|
10
10
|
#if os(iOS)
|
|
11
|
-
|
|
12
|
-
return true
|
|
13
|
-
}
|
|
14
|
-
if let offlineSupportEnabled = infoDictionary["BitmovinPlayerOfflineSupportEnabled"] as? Bool,
|
|
11
|
+
if let offlineSupportEnabled = Bundle.main.infoDictionary?["BitmovinPlayerOfflineSupportEnabled"] as? Bool,
|
|
15
12
|
offlineSupportEnabled {
|
|
16
13
|
OfflineManager.initializeOfflineManager()
|
|
17
14
|
}
|
|
18
|
-
|
|
19
|
-
if !BitmovinCastManager.isInitialized() {
|
|
20
|
-
let options = BitmovinCastManagerOptions()
|
|
21
|
-
if let applicationId = infoDictionary["BitmovinPlayerGoogleCastApplicationId"] as? String {
|
|
22
|
-
options.applicationId = applicationId
|
|
23
|
-
}
|
|
24
|
-
if let messageNamespace = infoDictionary["BitmovinPlayerGoogleCastMessageNamespace"] as? String {
|
|
25
|
-
options.messageNamespace = messageNamespace
|
|
26
|
-
}
|
|
27
|
-
BitmovinCastManager.initializeCasting(options: options)
|
|
28
|
-
}
|
|
29
15
|
#endif
|
|
30
16
|
return true
|
|
31
17
|
}
|
|
@@ -5,6 +5,22 @@ public class BitmovinCastManagerModule: Module {
|
|
|
5
5
|
public func definition() -> ModuleDefinition {
|
|
6
6
|
Name("BitmovinCastManagerModule")
|
|
7
7
|
|
|
8
|
+
AsyncFunction("initializeCastManager") { (options: [String: Any]?) throws in
|
|
9
|
+
#if os(iOS)
|
|
10
|
+
if let options {
|
|
11
|
+
guard let options = RCTConvert.castManagerOptions(options) else {
|
|
12
|
+
throw Exception(
|
|
13
|
+
name: "DESERIALIZATION_ERROR",
|
|
14
|
+
description: "Could not deserialize BitmovinCastManagerOptions"
|
|
15
|
+
)
|
|
16
|
+
}
|
|
17
|
+
BitmovinCastManager.initializeCasting(options: options)
|
|
18
|
+
} else {
|
|
19
|
+
BitmovinCastManager.initializeCasting()
|
|
20
|
+
}
|
|
21
|
+
#endif
|
|
22
|
+
}.runOnQueue(.main)
|
|
23
|
+
|
|
8
24
|
AsyncFunction("isInitialized") { () -> Bool in
|
|
9
25
|
#if os(iOS)
|
|
10
26
|
return BitmovinCastManager.isInitialized()
|
|
@@ -28,7 +28,7 @@ Pod::Spec.new do |s|
|
|
|
28
28
|
s.static_framework = true
|
|
29
29
|
|
|
30
30
|
s.dependency 'ExpoModulesCore'
|
|
31
|
-
s.dependency "BitmovinPlayer", "3.
|
|
31
|
+
s.dependency "BitmovinPlayer", "3.102.0"
|
|
32
32
|
s.ios.dependency "GoogleAds-IMA-iOS-SDK", "3.26.1"
|
|
33
33
|
s.tvos.dependency "GoogleAds-IMA-tvOS-SDK", "4.15.1"
|
|
34
34
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bitmovin-player-react-native",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.0-alpha.0",
|
|
4
4
|
"description": "Official React Native bindings for Bitmovin's mobile Player SDKs.",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"eslint-config-expo": "~9.2.0",
|
|
68
68
|
"eslint-config-prettier": "^9.1.0",
|
|
69
69
|
"eslint-plugin-prettier": "^5.5.1",
|
|
70
|
-
"expo": "53.0.
|
|
70
|
+
"expo": "53.0.20",
|
|
71
71
|
"expo-module-scripts": "^4.1.9",
|
|
72
72
|
"lint-staged": "13.0.3",
|
|
73
73
|
"prettier": "^3.6.2",
|
|
@@ -2,17 +2,12 @@ export default interface Features {
|
|
|
2
2
|
airPlay?: boolean;
|
|
3
3
|
backgroundPlayback?: boolean;
|
|
4
4
|
googleCastSDK?: {
|
|
5
|
-
appId?: string;
|
|
6
|
-
messageNamespace?: string;
|
|
7
5
|
android: string | {
|
|
8
6
|
version: string;
|
|
9
|
-
appId?: string;
|
|
10
|
-
messageNamespace?: string;
|
|
11
7
|
};
|
|
12
8
|
ios: string | {
|
|
13
9
|
version: string;
|
|
14
10
|
appId?: string;
|
|
15
|
-
messageNamespace?: string;
|
|
16
11
|
localNetworkUsageDescription?: string;
|
|
17
12
|
};
|
|
18
13
|
};
|
|
@@ -120,22 +120,6 @@ const withBitmovinAndroidConfig = (config, options) => {
|
|
|
120
120
|
mainApplication.activity.push(expandedControllerActivity);
|
|
121
121
|
}
|
|
122
122
|
config_plugins_1.AndroidConfig.Manifest.addMetaDataItemToMainApplication(mainApplication, 'com.google.android.gms.cast.framework.OPTIONS_PROVIDER_CLASS_NAME', 'com.bitmovin.player.casting.BitmovinCastOptionsProvider');
|
|
123
|
-
let appId = features.googleCastSDK.appId;
|
|
124
|
-
let messageNamespace = features.googleCastSDK.messageNamespace;
|
|
125
|
-
if (typeof features.googleCastSDK.android == 'object') {
|
|
126
|
-
// Override the top level appId and messageNamespace
|
|
127
|
-
appId = features.googleCastSDK.android?.appId || appId;
|
|
128
|
-
messageNamespace =
|
|
129
|
-
features.googleCastSDK.android.messageNamespace || messageNamespace;
|
|
130
|
-
}
|
|
131
|
-
if (appId) {
|
|
132
|
-
config_plugins_1.AndroidConfig.Manifest.addMetaDataItemToMainApplication(mainApplication, 'BITMOVIN_CAST_APP_ID', appId);
|
|
133
|
-
// Adding a messageNamespace inside the appId if block,
|
|
134
|
-
// as there should not be a custom namespace without a custom appId
|
|
135
|
-
if (messageNamespace) {
|
|
136
|
-
config_plugins_1.AndroidConfig.Manifest.addMetaDataItemToMainApplication(mainApplication, 'BITMOVIN_CAST_MESSAGE_NAMESPACE', messageNamespace);
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
123
|
}
|
|
140
124
|
return config;
|
|
141
125
|
});
|
|
@@ -162,11 +146,9 @@ const withBitmovinAndroidConfig = (config, options) => {
|
|
|
162
146
|
properties.splice(config.modResults.indexOf(existingEntry), 1);
|
|
163
147
|
}
|
|
164
148
|
const mavenRepos = JSON.parse(existingEntry?.type == 'property' ? existingEntry.value : '[]');
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
mavenRepos.push({ url: bitmovinRepoUrl });
|
|
169
|
-
}
|
|
149
|
+
mavenRepos.push({
|
|
150
|
+
url: 'https://artifacts.bitmovin.com/artifactory/public-releases',
|
|
151
|
+
});
|
|
170
152
|
properties.push({
|
|
171
153
|
type: 'property',
|
|
172
154
|
key: 'android.extraMavenRepos',
|
|
@@ -13,24 +13,15 @@ const withBitmovinIosConfig = (config, options) => {
|
|
|
13
13
|
},
|
|
14
14
|
ios: { isEnabled: !!features.offline },
|
|
15
15
|
};
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
let googleCastMessageNamespace = googleCastConfig?.messageNamespace;
|
|
22
|
-
if (typeof googleCastConfig?.ios == 'object') {
|
|
23
|
-
googleCastAppId = googleCastConfig?.ios?.appId || googleCastAppId;
|
|
24
|
-
googleCastMessageNamespace =
|
|
25
|
-
googleCastConfig?.ios?.messageNamespace || googleCastMessageNamespace;
|
|
26
|
-
}
|
|
16
|
+
const googleCastIosConfig = features.googleCastSDK?.ios
|
|
17
|
+
? typeof features.googleCastSDK.ios === 'string'
|
|
18
|
+
? { version: features.googleCastSDK.ios }
|
|
19
|
+
: features.googleCastSDK.ios
|
|
20
|
+
: null;
|
|
27
21
|
config = (0, config_plugins_1.withInfoPlist)(config, (config) => {
|
|
28
22
|
if (playerLicenseKey) {
|
|
29
23
|
config.modResults['BitmovinPlayerLicenseKey'] = playerLicenseKey;
|
|
30
24
|
}
|
|
31
|
-
else {
|
|
32
|
-
delete config.modResults['BitmovinPlayerLicenseKey'];
|
|
33
|
-
}
|
|
34
25
|
if (features.backgroundPlayback ||
|
|
35
26
|
features.airPlay ||
|
|
36
27
|
features.pictureInPicture) {
|
|
@@ -42,44 +33,25 @@ const withBitmovinIosConfig = (config, options) => {
|
|
|
42
33
|
if (offlineFeatureConfig?.ios?.isEnabled) {
|
|
43
34
|
config.modResults['BitmovinPlayerOfflineSupportEnabled'] = true;
|
|
44
35
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
const localNetworkUsageDescription = typeof googleCastConfig?.ios === 'object'
|
|
50
|
-
? googleCastConfig?.ios?.localNetworkUsageDescription
|
|
51
|
-
: '${PRODUCT_NAME} uses the local network to discover Cast-enabled devices on your WiFi network.';
|
|
52
|
-
config.modResults['BitmovinPlayerGoogleCastApplicationId'] =
|
|
53
|
-
googleCastAppId;
|
|
54
|
-
if (googleCastMessageNamespace) {
|
|
55
|
-
config.modResults['BitmovinPlayerGoogleCastMessageNamespace'] =
|
|
56
|
-
googleCastMessageNamespace;
|
|
57
|
-
}
|
|
58
|
-
else {
|
|
59
|
-
delete config.modResults['BitmovinPlayerGoogleCastMessageNamespace'];
|
|
60
|
-
}
|
|
36
|
+
if (googleCastIosConfig) {
|
|
37
|
+
const appId = googleCastIosConfig.appId || 'FFE417E5';
|
|
38
|
+
const localNetworkUsageDescription = googleCastIosConfig.localNetworkUsageDescription ||
|
|
39
|
+
'${PRODUCT_NAME} uses the local network to discover Cast-enabled devices on your WiFi network.';
|
|
61
40
|
config.modResults['NSBonjourServices'] = [
|
|
62
41
|
'_googlecast._tcp',
|
|
63
|
-
`_${
|
|
42
|
+
`_${appId}._googlecast._tcp`,
|
|
64
43
|
];
|
|
65
44
|
config.modResults['NSLocalNetworkUsageDescription'] =
|
|
66
45
|
localNetworkUsageDescription;
|
|
67
46
|
}
|
|
68
|
-
else {
|
|
69
|
-
delete config.modResults['BitmovinPlayerGoogleCastApplicationId'];
|
|
70
|
-
delete config.modResults['BitmovinPlayerGoogleCastMessageNamespace'];
|
|
71
|
-
}
|
|
72
47
|
}
|
|
73
48
|
return config;
|
|
74
49
|
});
|
|
75
50
|
if (!isTV) {
|
|
76
51
|
config = (0, config_plugins_1.withPodfileProperties)(config, (config) => {
|
|
77
|
-
if (
|
|
52
|
+
if (googleCastIosConfig) {
|
|
78
53
|
config.modResults['BITMOVIN_GOOGLE_CAST_SDK_VERSION'] =
|
|
79
|
-
|
|
80
|
-
}
|
|
81
|
-
else {
|
|
82
|
-
delete config.modResults['BITMOVIN_GOOGLE_CAST_SDK_VERSION'];
|
|
54
|
+
googleCastIosConfig.version;
|
|
83
55
|
}
|
|
84
56
|
return config;
|
|
85
57
|
});
|
package/plugin/src/Features.ts
CHANGED
|
@@ -2,21 +2,12 @@ export default interface Features {
|
|
|
2
2
|
airPlay?: boolean;
|
|
3
3
|
backgroundPlayback?: boolean;
|
|
4
4
|
googleCastSDK?: {
|
|
5
|
-
|
|
6
|
-
messageNamespace?: string;
|
|
7
|
-
android:
|
|
8
|
-
| string
|
|
9
|
-
| {
|
|
10
|
-
version: string;
|
|
11
|
-
appId?: string;
|
|
12
|
-
messageNamespace?: string;
|
|
13
|
-
};
|
|
5
|
+
android: string | { version: string };
|
|
14
6
|
ios:
|
|
15
7
|
| string
|
|
16
8
|
| {
|
|
17
9
|
version: string;
|
|
18
10
|
appId?: string;
|
|
19
|
-
messageNamespace?: string;
|
|
20
11
|
localNetworkUsageDescription?: string;
|
|
21
12
|
};
|
|
22
13
|
};
|
|
@@ -166,33 +166,6 @@ const withBitmovinAndroidConfig: ConfigPlugin<BitmovinConfigOptions> = (
|
|
|
166
166
|
'com.google.android.gms.cast.framework.OPTIONS_PROVIDER_CLASS_NAME',
|
|
167
167
|
'com.bitmovin.player.casting.BitmovinCastOptionsProvider'
|
|
168
168
|
);
|
|
169
|
-
|
|
170
|
-
let appId = features.googleCastSDK.appId;
|
|
171
|
-
let messageNamespace = features.googleCastSDK.messageNamespace;
|
|
172
|
-
if (typeof features.googleCastSDK.android == 'object') {
|
|
173
|
-
// Override the top level appId and messageNamespace
|
|
174
|
-
appId = features.googleCastSDK.android?.appId || appId;
|
|
175
|
-
messageNamespace =
|
|
176
|
-
features.googleCastSDK.android.messageNamespace || messageNamespace;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
if (appId) {
|
|
180
|
-
AndroidConfig.Manifest.addMetaDataItemToMainApplication(
|
|
181
|
-
mainApplication,
|
|
182
|
-
'BITMOVIN_CAST_APP_ID',
|
|
183
|
-
appId
|
|
184
|
-
);
|
|
185
|
-
|
|
186
|
-
// Adding a messageNamespace inside the appId if block,
|
|
187
|
-
// as there should not be a custom namespace without a custom appId
|
|
188
|
-
if (messageNamespace) {
|
|
189
|
-
AndroidConfig.Manifest.addMetaDataItemToMainApplication(
|
|
190
|
-
mainApplication,
|
|
191
|
-
'BITMOVIN_CAST_MESSAGE_NAMESPACE',
|
|
192
|
-
messageNamespace
|
|
193
|
-
);
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
169
|
}
|
|
197
170
|
|
|
198
171
|
return config;
|
|
@@ -236,12 +209,9 @@ const withBitmovinAndroidConfig: ConfigPlugin<BitmovinConfigOptions> = (
|
|
|
236
209
|
const mavenRepos = JSON.parse(
|
|
237
210
|
existingEntry?.type == 'property' ? existingEntry.value : '[]'
|
|
238
211
|
);
|
|
239
|
-
|
|
240
|
-
'https://artifacts.bitmovin.com/artifactory/public-releases'
|
|
241
|
-
|
|
242
|
-
if (!mavenRepos.some((repo: any) => repo.url === bitmovinRepoUrl)) {
|
|
243
|
-
mavenRepos.push({ url: bitmovinRepoUrl });
|
|
244
|
-
}
|
|
212
|
+
mavenRepos.push({
|
|
213
|
+
url: 'https://artifacts.bitmovin.com/artifactory/public-releases',
|
|
214
|
+
});
|
|
245
215
|
properties.push({
|
|
246
216
|
type: 'property',
|
|
247
217
|
key: 'android.extraMavenRepos',
|
|
@@ -22,26 +22,15 @@ const withBitmovinIosConfig: ConfigPlugin<BitmovinConfigOptions> = (
|
|
|
22
22
|
},
|
|
23
23
|
ios: { isEnabled: !!features.offline },
|
|
24
24
|
};
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
: googleCastConfig?.ios;
|
|
31
|
-
let googleCastAppId = googleCastConfig?.appId || 'FFE417E5';
|
|
32
|
-
let googleCastMessageNamespace = googleCastConfig?.messageNamespace;
|
|
33
|
-
|
|
34
|
-
if (typeof googleCastConfig?.ios == 'object') {
|
|
35
|
-
googleCastAppId = googleCastConfig?.ios?.appId || googleCastAppId;
|
|
36
|
-
googleCastMessageNamespace =
|
|
37
|
-
googleCastConfig?.ios?.messageNamespace || googleCastMessageNamespace;
|
|
38
|
-
}
|
|
25
|
+
const googleCastIosConfig = features.googleCastSDK?.ios
|
|
26
|
+
? typeof features.googleCastSDK.ios === 'string'
|
|
27
|
+
? { version: features.googleCastSDK.ios }
|
|
28
|
+
: features.googleCastSDK.ios
|
|
29
|
+
: null;
|
|
39
30
|
|
|
40
31
|
config = withInfoPlist(config, (config) => {
|
|
41
32
|
if (playerLicenseKey) {
|
|
42
33
|
config.modResults['BitmovinPlayerLicenseKey'] = playerLicenseKey;
|
|
43
|
-
} else {
|
|
44
|
-
delete config.modResults['BitmovinPlayerLicenseKey'];
|
|
45
34
|
}
|
|
46
35
|
if (
|
|
47
36
|
features.backgroundPlayback ||
|
|
@@ -57,33 +46,19 @@ const withBitmovinIosConfig: ConfigPlugin<BitmovinConfigOptions> = (
|
|
|
57
46
|
if (!isTV) {
|
|
58
47
|
if (offlineFeatureConfig?.ios?.isEnabled) {
|
|
59
48
|
config.modResults['BitmovinPlayerOfflineSupportEnabled'] = true;
|
|
60
|
-
} else {
|
|
61
|
-
delete config.modResults['BitmovinPlayerOfflineSupportEnabled'];
|
|
62
49
|
}
|
|
63
|
-
if (
|
|
50
|
+
if (googleCastIosConfig) {
|
|
51
|
+
const appId = googleCastIosConfig.appId || 'FFE417E5';
|
|
64
52
|
const localNetworkUsageDescription =
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
: '${PRODUCT_NAME} uses the local network to discover Cast-enabled devices on your WiFi network.';
|
|
68
|
-
|
|
69
|
-
config.modResults['BitmovinPlayerGoogleCastApplicationId'] =
|
|
70
|
-
googleCastAppId;
|
|
71
|
-
if (googleCastMessageNamespace) {
|
|
72
|
-
config.modResults['BitmovinPlayerGoogleCastMessageNamespace'] =
|
|
73
|
-
googleCastMessageNamespace;
|
|
74
|
-
} else {
|
|
75
|
-
delete config.modResults['BitmovinPlayerGoogleCastMessageNamespace'];
|
|
76
|
-
}
|
|
53
|
+
googleCastIosConfig.localNetworkUsageDescription ||
|
|
54
|
+
'${PRODUCT_NAME} uses the local network to discover Cast-enabled devices on your WiFi network.';
|
|
77
55
|
|
|
78
56
|
config.modResults['NSBonjourServices'] = [
|
|
79
57
|
'_googlecast._tcp',
|
|
80
|
-
`_${
|
|
58
|
+
`_${appId}._googlecast._tcp`,
|
|
81
59
|
];
|
|
82
60
|
config.modResults['NSLocalNetworkUsageDescription'] =
|
|
83
61
|
localNetworkUsageDescription;
|
|
84
|
-
} else {
|
|
85
|
-
delete config.modResults['BitmovinPlayerGoogleCastApplicationId'];
|
|
86
|
-
delete config.modResults['BitmovinPlayerGoogleCastMessageNamespace'];
|
|
87
62
|
}
|
|
88
63
|
}
|
|
89
64
|
return config;
|
|
@@ -91,11 +66,9 @@ const withBitmovinIosConfig: ConfigPlugin<BitmovinConfigOptions> = (
|
|
|
91
66
|
|
|
92
67
|
if (!isTV) {
|
|
93
68
|
config = withPodfileProperties(config, (config) => {
|
|
94
|
-
if (
|
|
69
|
+
if (googleCastIosConfig) {
|
|
95
70
|
config.modResults['BITMOVIN_GOOGLE_CAST_SDK_VERSION'] =
|
|
96
|
-
|
|
97
|
-
} else {
|
|
98
|
-
delete config.modResults['BITMOVIN_GOOGLE_CAST_SDK_VERSION'];
|
|
71
|
+
googleCastIosConfig.version;
|
|
99
72
|
}
|
|
100
73
|
return config;
|
|
101
74
|
});
|
|
@@ -46,8 +46,6 @@ export const BitmovinCastManager = {
|
|
|
46
46
|
*
|
|
47
47
|
* @param options The options to be used for initializing `BitmovinCastManager`
|
|
48
48
|
* @returns A promise that resolves when the `BitmovinCastManager` was initialized successfully
|
|
49
|
-
*
|
|
50
|
-
* @deprecated This method is deprecated and will be removed in future versions. Please initialize BitmovinCastManager via ExpoConfig or Info.plist on iOS and AndroidManifest.xml on Android.
|
|
51
49
|
*/
|
|
52
50
|
initialize: async (
|
|
53
51
|
options: BitmovinCastManagerOptions | null = null
|
|
@@ -55,10 +53,9 @@ export const BitmovinCastManager = {
|
|
|
55
53
|
if (Platform.OS === 'ios' && Platform.isTV) {
|
|
56
54
|
return Promise.resolve();
|
|
57
55
|
}
|
|
58
|
-
|
|
59
|
-
|
|
56
|
+
return BitmovinCastManagerModule.initializeCastManager(
|
|
57
|
+
options || undefined
|
|
60
58
|
);
|
|
61
|
-
return Promise.resolve();
|
|
62
59
|
},
|
|
63
60
|
|
|
64
61
|
/**
|
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
export enum PictureInPictureAction {
|
|
2
2
|
/**
|
|
3
3
|
* Picture in Picture window shows Play/Pause button depending on the player state.
|
|
4
|
-
*
|
|
5
|
-
* @remarks When using the {@link UserInterfaceType.System}, this property is only supported on iOS 17 and above.
|
|
6
|
-
*
|
|
7
|
-
* @platform iOS, Android
|
|
8
4
|
*/
|
|
9
5
|
TogglePlayback = 'TogglePlayback',
|
|
10
6
|
/**
|
|
11
7
|
* Picture in Picture window shows seek forward and seek backward buttons.
|
|
12
8
|
* The player seeks by 10s when the buttons are pressed.
|
|
13
|
-
*
|
|
14
|
-
* @platform iOS, Android
|
|
15
9
|
*/
|
|
16
10
|
Seek = 'Seek',
|
|
17
11
|
}
|
package/src/hooks/useProxy.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { RefObject, useCallback } from 'react';
|
|
2
2
|
import { Event } from '../events';
|
|
3
|
-
import { findNodeHandle } from 'react-native';
|
|
4
3
|
import { normalizeNonFinite } from '../utils/normalizeNonFinite';
|
|
5
4
|
|
|
6
5
|
/**
|
|
@@ -22,10 +21,7 @@ export function useProxy(
|
|
|
22
21
|
return useCallback(
|
|
23
22
|
<E extends Event>(callback?: Callback<E>) =>
|
|
24
23
|
(event: { nativeEvent: E }) => {
|
|
25
|
-
|
|
26
|
-
if (eventTargetNodeHandle !== findNodeHandle(viewRef.current)) {
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
24
|
+
// Remove the target field from the event as it's React Native internal metadata
|
|
29
25
|
const { target, ...eventWithoutTarget } = event.nativeEvent as any;
|
|
30
26
|
const sanitized = normalizeNonFinite(eventWithoutTarget);
|
|
31
27
|
callback?.(sanitized as E);
|
|
@@ -4,6 +4,7 @@ export type BitmovinCastManagerModuleEvents = Record<string, any>;
|
|
|
4
4
|
|
|
5
5
|
declare class BitmovinCastManagerModule extends NativeModule<BitmovinCastManagerModuleEvents> {
|
|
6
6
|
isInitialized(): Promise<boolean>;
|
|
7
|
+
initializeCastManager(options?: Record<string, any>): Promise<void>;
|
|
7
8
|
sendMessage(message: string, messageNamespace?: string): Promise<void>;
|
|
8
9
|
updateContext?(): Promise<void>; // Android only
|
|
9
10
|
}
|
package/src/styleConfig.ts
CHANGED
|
@@ -107,13 +107,10 @@ export enum ScalingMode {
|
|
|
107
107
|
export enum UserInterfaceType {
|
|
108
108
|
/**
|
|
109
109
|
* Indicates that Bitmovin's customizable UI should be used.
|
|
110
|
-
*
|
|
111
|
-
* @platform iOS, Android
|
|
112
110
|
*/
|
|
113
111
|
Bitmovin = 'Bitmovin',
|
|
114
112
|
/**
|
|
115
113
|
* Indicates that the system UI should be used.
|
|
116
|
-
*
|
|
117
114
|
* @platform iOS, tvOS
|
|
118
115
|
*/
|
|
119
116
|
System = 'System',
|