@applicaster/zapp-react-native-ui-components 14.0.0-alpha.4111088201 → 14.0.0-alpha.4552519200
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,7 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { useEffect, useReducer } from "react";
|
|
3
|
-
|
|
4
|
-
import { TVMenuControl, View, ViewStyle } from "react-native";
|
|
3
|
+
import { View, ViewStyle } from "react-native";
|
|
5
4
|
import * as R from "ramda";
|
|
6
5
|
import uuid from "uuid/v4";
|
|
7
6
|
import { playerManager } from "@applicaster/zapp-react-native-utils/appUtils/playerManager";
|
|
@@ -62,6 +61,11 @@ import {
|
|
|
62
61
|
useModalAnimationContext,
|
|
63
62
|
} from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation";
|
|
64
63
|
|
|
64
|
+
import {
|
|
65
|
+
PlayerNativeCommandTypes,
|
|
66
|
+
PlayerNativeSendCommand,
|
|
67
|
+
} from "@applicaster/zapp-react-native-utils/appUtils/playerManager/playerNativeCommand";
|
|
68
|
+
|
|
65
69
|
type Props = {
|
|
66
70
|
Player: React.ComponentType<any>;
|
|
67
71
|
PlayerLoadingView?: React.ComponentType<any>; // 👀 we are not receiving this prop
|
|
@@ -260,9 +264,15 @@ const PlayerContainerComponent = (props: Props) => {
|
|
|
260
264
|
return;
|
|
261
265
|
}
|
|
262
266
|
|
|
267
|
+
// send command to clear and stop player
|
|
268
|
+
PlayerNativeSendCommand(
|
|
269
|
+
PlayerNativeCommandTypes.clearPlayerData,
|
|
270
|
+
state.playerId
|
|
271
|
+
);
|
|
272
|
+
|
|
263
273
|
showNavBar(true);
|
|
264
274
|
navigator.goBack();
|
|
265
|
-
}, [isModal, navigator.goBack, showNavBar]);
|
|
275
|
+
}, [isModal, navigator.goBack, state.playerId, showNavBar]);
|
|
266
276
|
|
|
267
277
|
const playEntry = (entry) => navigator.replaceTop(entry, { mode });
|
|
268
278
|
|
|
@@ -390,13 +400,19 @@ const PlayerContainerComponent = (props: Props) => {
|
|
|
390
400
|
}
|
|
391
401
|
};
|
|
392
402
|
|
|
393
|
-
const playerRemoteHandler = (
|
|
394
|
-
|
|
403
|
+
const playerRemoteHandler = React.useCallback(
|
|
404
|
+
(isLanguageOverlayVisible = false) =>
|
|
405
|
+
(event) => {
|
|
406
|
+
const { eventType } = event;
|
|
395
407
|
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
408
|
+
console.log("PlayerContainer: playerRemoteHandler", eventType);
|
|
409
|
+
|
|
410
|
+
if (!isLanguageOverlayVisible && eventType === "menu") {
|
|
411
|
+
close();
|
|
412
|
+
}
|
|
413
|
+
},
|
|
414
|
+
[close]
|
|
415
|
+
);
|
|
400
416
|
|
|
401
417
|
// Effects
|
|
402
418
|
useEffect(() => {
|
|
@@ -509,16 +525,6 @@ const PlayerContainerComponent = (props: Props) => {
|
|
|
509
525
|
}
|
|
510
526
|
}, [isAudioContent]);
|
|
511
527
|
|
|
512
|
-
// Needs to handle back button on Apple TV
|
|
513
|
-
// https://github.com/facebook/react-native/issues/18930
|
|
514
|
-
useEffect(() => {
|
|
515
|
-
TVMenuControl?.enableTVMenuKey();
|
|
516
|
-
|
|
517
|
-
return () => {
|
|
518
|
-
TVMenuControl?.disableTVMenuKey();
|
|
519
|
-
};
|
|
520
|
-
}, []);
|
|
521
|
-
|
|
522
528
|
useEffect(() => {
|
|
523
529
|
playerEvent("source_changed", { item });
|
|
524
530
|
|
|
@@ -627,9 +633,9 @@ const PlayerContainerComponent = (props: Props) => {
|
|
|
627
633
|
<PlayerContainerContext.Consumer>
|
|
628
634
|
{(context) => (
|
|
629
635
|
<TVEventHandlerComponent
|
|
630
|
-
tvEventHandler={(
|
|
631
|
-
|
|
632
|
-
}
|
|
636
|
+
tvEventHandler={playerRemoteHandler(
|
|
637
|
+
context.isLanguageOverlayVisible
|
|
638
|
+
)}
|
|
633
639
|
>
|
|
634
640
|
<FocusableGroup
|
|
635
641
|
id={FocusableGroupMainContainerId}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applicaster/zapp-react-native-ui-components",
|
|
3
|
-
"version": "14.0.0-alpha.
|
|
3
|
+
"version": "14.0.0-alpha.4552519200",
|
|
4
4
|
"description": "Applicaster Zapp React Native ui components for the Quick Brick App",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -31,10 +31,10 @@
|
|
|
31
31
|
"redux-mock-store": "^1.5.3"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@applicaster/applicaster-types": "14.0.0-alpha.
|
|
35
|
-
"@applicaster/zapp-react-native-bridge": "14.0.0-alpha.
|
|
36
|
-
"@applicaster/zapp-react-native-redux": "14.0.0-alpha.
|
|
37
|
-
"@applicaster/zapp-react-native-utils": "14.0.0-alpha.
|
|
34
|
+
"@applicaster/applicaster-types": "14.0.0-alpha.4552519200",
|
|
35
|
+
"@applicaster/zapp-react-native-bridge": "14.0.0-alpha.4552519200",
|
|
36
|
+
"@applicaster/zapp-react-native-redux": "14.0.0-alpha.4552519200",
|
|
37
|
+
"@applicaster/zapp-react-native-utils": "14.0.0-alpha.4552519200",
|
|
38
38
|
"promise": "^8.3.0",
|
|
39
39
|
"url": "^0.11.0",
|
|
40
40
|
"uuid": "^3.3.2"
|