@castlabs/react-native-prestoplay-ios-avplayerviewcontroller 1.0.2 → 1.1.1
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.
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Plugin } from '@castlabs/react-native-prestoplay';
|
|
2
|
-
import { AVPlayerViewControllerExtension } from './AVPlayerViewControllerExtension';
|
|
3
2
|
/**
|
|
4
3
|
* Provides {@link AVPlayerViewControllerProvider} integration for iOS and tvOS.
|
|
5
4
|
*
|
|
@@ -14,7 +13,7 @@ export default class AVPlayerViewControllerPlugin extends Plugin {
|
|
|
14
13
|
return 'RNPrestoplayAVPlayerViewControllerPluginFactory';
|
|
15
14
|
}
|
|
16
15
|
/** @hidden */
|
|
17
|
-
onPlayerCreated(
|
|
18
|
-
player.addExtension(new AVPlayerViewControllerExtension(player));
|
|
16
|
+
onPlayerCreated(_player) {
|
|
17
|
+
//player.addExtension(new AVPlayerViewControllerExtension(player));
|
|
19
18
|
}
|
|
20
19
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { memo, useEffect, useMemo } from 'react';
|
|
2
2
|
import { EventType, PlayerContext, } from '@castlabs/react-native-prestoplay';
|
|
3
3
|
import { Player } from '@castlabs/react-native-prestoplay';
|
|
4
|
+
import { AVPlayerViewControllerExtension } from '../AVPlayerViewControllerExtension';
|
|
4
5
|
/**
|
|
5
6
|
* An alternative to the `PlayerProvider` component, which uses an
|
|
6
7
|
* AVPlayerViewController to present the player UI on iOS and tvOS.
|
|
@@ -12,7 +13,9 @@ import { Player } from '@castlabs/react-native-prestoplay';
|
|
|
12
13
|
*/
|
|
13
14
|
export const AVPlayerViewControllerProvider = memo(function ({ playerConfig, onClose, children, }) {
|
|
14
15
|
const player = useMemo(() => {
|
|
15
|
-
|
|
16
|
+
const player_ = new Player(true);
|
|
17
|
+
player_.addExtension(new AVPlayerViewControllerExtension(player_));
|
|
18
|
+
return player_;
|
|
16
19
|
}, []);
|
|
17
20
|
useEffect(() => {
|
|
18
21
|
const onEvent = (_event) => {
|
|
@@ -29,7 +32,6 @@ export const AVPlayerViewControllerProvider = memo(function ({ playerConfig, onC
|
|
|
29
32
|
const playerConfigHash = JSON.stringify(playerConfig);
|
|
30
33
|
useEffect(() => {
|
|
31
34
|
if (playerConfig) {
|
|
32
|
-
console.info('Opening player with config:', playerConfig);
|
|
33
35
|
player.open(playerConfig).catch(error => {
|
|
34
36
|
console.error('Error opening player:', error);
|
|
35
37
|
});
|
package/package.json
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@castlabs/react-native-prestoplay-ios-avplayerviewcontroller",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"prestoplayAppleSdkVersion": "4.0.
|
|
5
|
-
"prestoplayAndroidSdkVersion": "4.4.
|
|
3
|
+
"version": "1.1.1",
|
|
4
|
+
"prestoplayAppleSdkVersion": "4.0.24",
|
|
5
|
+
"prestoplayAndroidSdkVersion": "4.4.6",
|
|
6
|
+
"prestoplayWebSdkVersion": "6.26.0",
|
|
6
7
|
"description": "PRESTOplay for React Native",
|
|
7
8
|
"homepage": "https://castlabs.com/playback/prestoplay/react-native/",
|
|
8
9
|
"bugs": {
|
|
9
10
|
"url": "https://support.castlabs.com/"
|
|
10
11
|
},
|
|
11
12
|
"license": "SEE LICENSE IN https://castlabs.com/legal/",
|
|
12
|
-
"author": "
|
|
13
|
+
"author": "Castlabs",
|
|
13
14
|
"main": "lib/index.js",
|
|
14
15
|
"react-native": "lib/index",
|
|
15
16
|
"types": "lib/index.d.ts",
|
|
@@ -45,7 +46,7 @@
|
|
|
45
46
|
"typescript": "5.0.4"
|
|
46
47
|
},
|
|
47
48
|
"dependencies": {
|
|
48
|
-
"@castlabs/react-native-prestoplay": "1.
|
|
49
|
+
"@castlabs/react-native-prestoplay": "1.1.1"
|
|
49
50
|
},
|
|
50
51
|
"keywords": [
|
|
51
52
|
"react native player",
|