@applicaster/zapp-react-native-ui-components 14.0.10-alpha.4515005205 → 14.0.10-alpha.5277434425
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,16 +1,11 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { usePickFromState } from "@applicaster/zapp-react-native-redux/hooks";
|
|
3
|
-
import {
|
|
4
|
-
useDimensions,
|
|
5
|
-
useIsTablet as isTablet,
|
|
6
|
-
useNavigation,
|
|
7
|
-
} from "@applicaster/zapp-react-native-utils/reactHooks";
|
|
3
|
+
import { useNavigation } from "@applicaster/zapp-react-native-utils/reactHooks";
|
|
8
4
|
|
|
9
5
|
import { BufferAnimation } from "../PlayerContainer/BufferAnimation";
|
|
10
6
|
import { PlayerContainer } from "../PlayerContainer";
|
|
11
7
|
import { useModalSize } from "../VideoModal/hooks";
|
|
12
8
|
import { ViewStyle } from "react-native";
|
|
13
|
-
import { platformSelect } from "@applicaster/zapp-react-native-utils/reactUtils";
|
|
14
9
|
import { findCastPlugin, getPlayer } from "./utils";
|
|
15
10
|
|
|
16
11
|
type Props = {
|
|
@@ -26,13 +21,6 @@ type PlayableComponent = {
|
|
|
26
21
|
Component: React.ComponentType<any>;
|
|
27
22
|
};
|
|
28
23
|
|
|
29
|
-
const dimensionsContext: "window" | "screen" = platformSelect({
|
|
30
|
-
android_tv: "window",
|
|
31
|
-
amazon: "window",
|
|
32
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
33
|
-
default: isTablet() ? "window" : "screen", // on tablet, window represents correct values, on phone it's not as the screen could be rotated
|
|
34
|
-
});
|
|
35
|
-
|
|
36
24
|
export function HandlePlayable({
|
|
37
25
|
item,
|
|
38
26
|
isModal,
|
|
@@ -94,26 +82,15 @@ export function HandlePlayable({
|
|
|
94
82
|
});
|
|
95
83
|
}, [casting]);
|
|
96
84
|
|
|
97
|
-
const { width: screenWidth, height: screenHeight } =
|
|
98
|
-
useDimensions(dimensionsContext);
|
|
99
|
-
|
|
100
85
|
const modalSize = useModalSize();
|
|
101
86
|
|
|
102
87
|
const style = React.useMemo(
|
|
103
88
|
() =>
|
|
104
89
|
({
|
|
105
|
-
width: isModal
|
|
106
|
-
|
|
107
|
-
: mode === "PIP"
|
|
108
|
-
? "100%"
|
|
109
|
-
: screenWidth,
|
|
110
|
-
height: isModal
|
|
111
|
-
? modalSize.height
|
|
112
|
-
: mode === "PIP"
|
|
113
|
-
? "100%"
|
|
114
|
-
: screenHeight,
|
|
90
|
+
width: isModal ? modalSize.width : "100%",
|
|
91
|
+
height: isModal ? modalSize.height : "100%",
|
|
115
92
|
}) as ViewStyle,
|
|
116
|
-
[
|
|
93
|
+
[modalSize, isModal]
|
|
117
94
|
);
|
|
118
95
|
|
|
119
96
|
const Component = playable?.Component;
|
|
@@ -93,7 +93,13 @@ export function Screen(_props: Props) {
|
|
|
93
93
|
const isActive = useIsScreenActive();
|
|
94
94
|
|
|
95
95
|
const ref = React.useRef(null);
|
|
96
|
-
const
|
|
96
|
+
const isOrientationReady = useWaitForValidOrientation();
|
|
97
|
+
|
|
98
|
+
// Playable screens handle their own orientation via the native player plugin,
|
|
99
|
+
// so we skip the orientation wait gate to avoid a deadlock where the screen
|
|
100
|
+
// waits for landscape but blocks rendering that would trigger the rotation.
|
|
101
|
+
const isPlayableRoute = pathname?.includes("/playable");
|
|
102
|
+
const isReady = isOrientationReady || isPlayableRoute;
|
|
97
103
|
|
|
98
104
|
React.useEffect(() => {
|
|
99
105
|
if (ref.current && isActive && isReady) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applicaster/zapp-react-native-ui-components",
|
|
3
|
-
"version": "14.0.10-alpha.
|
|
3
|
+
"version": "14.0.10-alpha.5277434425",
|
|
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",
|
|
@@ -28,10 +28,10 @@
|
|
|
28
28
|
},
|
|
29
29
|
"homepage": "https://github.com/applicaster/quickbrick#readme",
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@applicaster/applicaster-types": "14.0.10-alpha.
|
|
32
|
-
"@applicaster/zapp-react-native-bridge": "14.0.10-alpha.
|
|
33
|
-
"@applicaster/zapp-react-native-redux": "14.0.10-alpha.
|
|
34
|
-
"@applicaster/zapp-react-native-utils": "14.0.10-alpha.
|
|
31
|
+
"@applicaster/applicaster-types": "14.0.10-alpha.5277434425",
|
|
32
|
+
"@applicaster/zapp-react-native-bridge": "14.0.10-alpha.5277434425",
|
|
33
|
+
"@applicaster/zapp-react-native-redux": "14.0.10-alpha.5277434425",
|
|
34
|
+
"@applicaster/zapp-react-native-utils": "14.0.10-alpha.5277434425",
|
|
35
35
|
"fast-json-stable-stringify": "^2.1.0",
|
|
36
36
|
"promise": "^8.3.0",
|
|
37
37
|
"url": "^0.11.0",
|