@applicaster/quick-brick-player 15.0.0-alpha.4069571733 → 15.0.0-alpha.4368022015
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/package.json +5 -5
- package/src/Player/AudioLayer/Layout/DockedControls/index.tsx +4 -3
- package/src/Player/PlayerModal/PlayerModal.tsx +4 -3
- package/src/Player/PlayerModal/VideoPlayerModal.tsx +10 -4
- package/src/Player/PlayerModal/hooks/index.ts +15 -10
- package/src/Player/PlayerModal/utils/index.ts +10 -10
- package/src/Player/index.tsx +4 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applicaster/quick-brick-player",
|
|
3
|
-
"version": "15.0.0-alpha.
|
|
3
|
+
"version": "15.0.0-alpha.4368022015",
|
|
4
4
|
"description": "Quick Brick Player",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -35,11 +35,11 @@
|
|
|
35
35
|
},
|
|
36
36
|
"homepage": "https://github.com/applicaster/quickbrick#readme",
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@applicaster/quick-brick-mobile-transport-controls": "15.0.0-
|
|
38
|
+
"@applicaster/quick-brick-mobile-transport-controls": "15.0.0-rc.27",
|
|
39
39
|
"@applicaster/quick-brick-tv-transport-controls": "15.0.0-rc.15",
|
|
40
|
-
"@applicaster/zapp-react-native-tvos-app": "15.0.0-alpha.
|
|
41
|
-
"@applicaster/zapp-react-native-ui-components": "15.0.0-alpha.
|
|
42
|
-
"@applicaster/zapp-react-native-utils": "15.0.0-alpha.
|
|
40
|
+
"@applicaster/zapp-react-native-tvos-app": "15.0.0-alpha.4368022015",
|
|
41
|
+
"@applicaster/zapp-react-native-ui-components": "15.0.0-alpha.4368022015",
|
|
42
|
+
"@applicaster/zapp-react-native-utils": "15.0.0-alpha.4368022015",
|
|
43
43
|
"query-string": "7.1.3",
|
|
44
44
|
"shaka-player": "4.3.5",
|
|
45
45
|
"typeface-montserrat": "^0.0.54",
|
|
@@ -90,7 +90,8 @@ const styles = StyleSheet.create({
|
|
|
90
90
|
marginTop: { marginTop: PROGRESS_BAR_HEIGHT },
|
|
91
91
|
});
|
|
92
92
|
|
|
93
|
-
const getValue = (key: string, stylesObj:
|
|
93
|
+
const getValue = (key: string, stylesObj: Record<string, any>) =>
|
|
94
|
+
stylesObj?.[key] ?? null;
|
|
94
95
|
|
|
95
96
|
const controlButtons = (
|
|
96
97
|
live: boolean,
|
|
@@ -208,7 +209,7 @@ export const DockedControls = (props: Props) => {
|
|
|
208
209
|
|
|
209
210
|
const insets = useSafeAreaInsets();
|
|
210
211
|
|
|
211
|
-
const
|
|
212
|
+
const progressBarLayoutState = React.useMemo(
|
|
212
213
|
() => ({
|
|
213
214
|
inline: layoutState.inline,
|
|
214
215
|
docked: true,
|
|
@@ -275,7 +276,7 @@ export const DockedControls = (props: Props) => {
|
|
|
275
276
|
content={entry}
|
|
276
277
|
value={value}
|
|
277
278
|
visible
|
|
278
|
-
layoutState={
|
|
279
|
+
layoutState={progressBarLayoutState}
|
|
279
280
|
onPlayerSeek={onPlayerSeek}
|
|
280
281
|
playerState={playerState}
|
|
281
282
|
docked
|
|
@@ -6,7 +6,7 @@ import { useStyles } from "./styles";
|
|
|
6
6
|
import { useVideoModalState } from "./hooks";
|
|
7
7
|
import { MODAL_COLLAPSE_RATIO, MODAL_RADIUS } from "./consts";
|
|
8
8
|
import { useModalAnimationContext } from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation";
|
|
9
|
-
import { getWindowHeight } from "./utils";
|
|
9
|
+
import { getScreenHeight, getWindowHeight } from "./utils";
|
|
10
10
|
|
|
11
11
|
type AnimatedModalProps = {
|
|
12
12
|
content?: ReactElement;
|
|
@@ -31,6 +31,7 @@ export function AnimatedModal({
|
|
|
31
31
|
|
|
32
32
|
const WINDOW_HEIGHT = getWindowHeight();
|
|
33
33
|
const heightAboveMinimised = WINDOW_HEIGHT - collapsedHeight;
|
|
34
|
+
const screenHeight = getScreenHeight();
|
|
34
35
|
|
|
35
36
|
const MODAL_COLLAPSE_START = WINDOW_HEIGHT * MODAL_COLLAPSE_RATIO;
|
|
36
37
|
|
|
@@ -63,7 +64,7 @@ export function AnimatedModal({
|
|
|
63
64
|
borderTopLeftRadius: borderTopRadiusAnimated,
|
|
64
65
|
borderTopRightRadius: borderTopRadiusAnimated,
|
|
65
66
|
transform: [{ translateY }],
|
|
66
|
-
height:
|
|
67
|
+
height: screenHeight,
|
|
67
68
|
},
|
|
68
69
|
]}
|
|
69
70
|
>
|
|
@@ -73,7 +74,7 @@ export function AnimatedModal({
|
|
|
73
74
|
{
|
|
74
75
|
borderTopLeftRadius: borderTopRadiusAnimated,
|
|
75
76
|
borderTopRightRadius: borderTopRadiusAnimated,
|
|
76
|
-
height:
|
|
77
|
+
height: screenHeight,
|
|
77
78
|
},
|
|
78
79
|
]}
|
|
79
80
|
>
|
|
@@ -18,7 +18,7 @@ import { PROGRESS_BAR_HEIGHT } from "@applicaster/zapp-react-native-ui-component
|
|
|
18
18
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
19
19
|
import { GestureAnimatedScrollView } from "./GestureAnimatedScrollView";
|
|
20
20
|
import { PlayerDetailsWrapperHeightContext } from "./context";
|
|
21
|
-
import { getWindowHeight, getWindowWidth } from "./utils";
|
|
21
|
+
import { getScreenHeight, getWindowHeight, getWindowWidth } from "./utils";
|
|
22
22
|
|
|
23
23
|
const orientationStyles = StyleSheet.create({
|
|
24
24
|
landscape: { flexDirection: "row" },
|
|
@@ -61,6 +61,7 @@ export function VideoPlayerModal({
|
|
|
61
61
|
|
|
62
62
|
const WINDOW_WIDTH = useMemo(() => getWindowWidth(), []); // remember initial width, ignore rotation changes
|
|
63
63
|
const height = useMemo(() => getWindowHeight(), []); // remember initial height, ignore rotation changes
|
|
64
|
+
const screenHeight = useMemo(() => getScreenHeight(), []); // remember initial height, ignore rotation changes
|
|
64
65
|
const MODAL_COLLAPSE_START = height * MODAL_COLLAPSE_RATIO;
|
|
65
66
|
|
|
66
67
|
let width = WINDOW_WIDTH;
|
|
@@ -129,7 +130,12 @@ export function VideoPlayerModal({
|
|
|
129
130
|
outputRange: [
|
|
130
131
|
0,
|
|
131
132
|
isTablet && isTabletLandscape
|
|
132
|
-
? -(
|
|
133
|
+
? -(
|
|
134
|
+
(-PROGRESS_BAR_HEIGHT +
|
|
135
|
+
screenHeight -
|
|
136
|
+
vidHeight * SCALE_FACTOR) /
|
|
137
|
+
2
|
|
138
|
+
)
|
|
133
139
|
: -(
|
|
134
140
|
PROGRESS_BAR_HEIGHT +
|
|
135
141
|
insets.top / 2 +
|
|
@@ -186,7 +192,7 @@ export function VideoPlayerModal({
|
|
|
186
192
|
borderTopLeftRadius: borderTopRadiusAnimated,
|
|
187
193
|
borderTopRightRadius: borderTopRadiusAnimated,
|
|
188
194
|
transform: [{ translateY: isFullScreenOrPIP ? 0 : translateY }],
|
|
189
|
-
height:
|
|
195
|
+
height: screenHeight,
|
|
190
196
|
},
|
|
191
197
|
]}
|
|
192
198
|
>
|
|
@@ -198,7 +204,7 @@ export function VideoPlayerModal({
|
|
|
198
204
|
{
|
|
199
205
|
borderTopLeftRadius: borderTopRadiusAnimated,
|
|
200
206
|
borderTopRightRadius: borderTopRadiusAnimated,
|
|
201
|
-
height:
|
|
207
|
+
height: screenHeight,
|
|
202
208
|
},
|
|
203
209
|
]}
|
|
204
210
|
>
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { useCallback, useEffect, useMemo, useRef } from "react";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
useSafeAreaFrame,
|
|
4
|
+
useSafeAreaInsets,
|
|
5
|
+
} from "react-native-safe-area-context";
|
|
3
6
|
import { State } from "react-native-gesture-handler";
|
|
4
7
|
import { Animated } from "react-native";
|
|
5
8
|
|
|
@@ -15,7 +18,7 @@ import {
|
|
|
15
18
|
} from "../consts";
|
|
16
19
|
import { PROGRESS_BAR_HEIGHT } from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation/utils";
|
|
17
20
|
import { usePlugins } from "@applicaster/zapp-react-native-redux";
|
|
18
|
-
import {
|
|
21
|
+
import { isOldAndroidDevice } from "../utils";
|
|
19
22
|
|
|
20
23
|
const bottomTabBarHeight = getTabBarHeight();
|
|
21
24
|
|
|
@@ -24,8 +27,6 @@ export const useVideoModalState = (
|
|
|
24
27
|
) => {
|
|
25
28
|
const { minimised_height: minimisedHeight } = useConfiguration();
|
|
26
29
|
|
|
27
|
-
const WINDOW_HEIGHT = getWindowHeight();
|
|
28
|
-
|
|
29
30
|
const {
|
|
30
31
|
maximiseVideoModal,
|
|
31
32
|
minimiseVideoModal,
|
|
@@ -42,17 +43,16 @@ export const useVideoModalState = (
|
|
|
42
43
|
videoModalState.visible &&
|
|
43
44
|
videoModalState.mode === VideoModalMode.MINIMIZED;
|
|
44
45
|
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
const initialBottomOffset = useRef(bottom).current;
|
|
46
|
+
const frame = useSafeAreaFrame();
|
|
47
|
+
const insets = useSafeAreaInsets();
|
|
48
48
|
|
|
49
49
|
const collapsedHeight =
|
|
50
50
|
minimisedHeight +
|
|
51
|
-
initialBottomOffset +
|
|
52
51
|
(menuVisible ? bottomTabBarHeight : 0) +
|
|
52
|
+
(isOldAndroidDevice ? 0 : insets.bottom) +
|
|
53
53
|
PROGRESS_BAR_HEIGHT;
|
|
54
54
|
|
|
55
|
-
const heightAboveMinimised =
|
|
55
|
+
const heightAboveMinimised = frame.height - collapsedHeight;
|
|
56
56
|
|
|
57
57
|
const translateY = translateYRef.current;
|
|
58
58
|
|
|
@@ -179,7 +179,12 @@ export const useVideoModalState = (
|
|
|
179
179
|
});
|
|
180
180
|
}
|
|
181
181
|
}
|
|
182
|
-
}, [
|
|
182
|
+
}, [
|
|
183
|
+
videoModalState.visible,
|
|
184
|
+
videoModalState.mode,
|
|
185
|
+
collapsedHeight,
|
|
186
|
+
heightAboveMinimised,
|
|
187
|
+
]);
|
|
183
188
|
|
|
184
189
|
return useMemo(
|
|
185
190
|
() => ({
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Dimensions } from "react-native";
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
isAndroidPlatform,
|
|
5
5
|
isAndroidVersionAtLeast,
|
|
6
6
|
} from "@applicaster/zapp-react-native-utils/reactUtils";
|
|
7
|
-
import { isAndroidTablet } from "@applicaster/zapp-react-native-utils/reactHooks/layout/isTablet";
|
|
8
7
|
|
|
9
8
|
const MIN_SUPPORTED_ANDROID_API = 34;
|
|
10
9
|
|
|
11
|
-
const isOldAndroidDevice =
|
|
12
|
-
isAndroidPlatform() &&
|
|
13
|
-
!isAndroidVersionAtLeast(MIN_SUPPORTED_ANDROID_API) &&
|
|
14
|
-
!isAndroidTablet();
|
|
10
|
+
export const isOldAndroidDevice =
|
|
11
|
+
isAndroidPlatform() && !isAndroidVersionAtLeast(MIN_SUPPORTED_ANDROID_API);
|
|
15
12
|
|
|
16
13
|
export const getWindowHeight = (): number => {
|
|
17
14
|
const windowDimensions = Dimensions.get("window");
|
|
18
15
|
|
|
19
|
-
return
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
return windowDimensions.height;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export const getScreenHeight = (): number => {
|
|
20
|
+
const screenDimensions = Dimensions.get("screen");
|
|
21
|
+
|
|
22
|
+
return screenDimensions.height;
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
export const getWindowWidth = (): number => {
|
package/src/Player/index.tsx
CHANGED
|
@@ -1128,10 +1128,10 @@ export default class VideoPlayer extends React.Component<
|
|
|
1128
1128
|
isTV() && this.getPlayNextData() && !docked;
|
|
1129
1129
|
|
|
1130
1130
|
const needsToRender =
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
docked;
|
|
1131
|
+
!hideTransportControls &&
|
|
1132
|
+
!needToShowPlayNextOverlay &&
|
|
1133
|
+
this.props.mode !== "PIP" &&
|
|
1134
|
+
!docked;
|
|
1135
1135
|
|
|
1136
1136
|
const supportsNativeControls =
|
|
1137
1137
|
!!this.props.controller?.supportsNativeControls?.();
|