@applicaster/quick-brick-player 14.0.0-alpha.1887720441 → 14.0.0-alpha.2012126431

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/quick-brick-player",
3
- "version": "14.0.0-alpha.1887720441",
3
+ "version": "14.0.0-alpha.2012126431",
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": "14.0.0-rc.40",
39
- "@applicaster/quick-brick-tv-transport-controls": "14.0.0-rc.37",
40
- "@applicaster/zapp-react-native-tvos-app": "14.0.0-alpha.1887720441",
41
- "@applicaster/zapp-react-native-ui-components": "14.0.0-alpha.1887720441",
42
- "@applicaster/zapp-react-native-utils": "14.0.0-alpha.1887720441",
38
+ "@applicaster/quick-brick-mobile-transport-controls": "14.0.0-rc.48",
39
+ "@applicaster/quick-brick-tv-transport-controls": "14.0.0-rc.48",
40
+ "@applicaster/zapp-react-native-tvos-app": "14.0.0-alpha.2012126431",
41
+ "@applicaster/zapp-react-native-ui-components": "14.0.0-alpha.2012126431",
42
+ "@applicaster/zapp-react-native-utils": "14.0.0-alpha.2012126431",
43
43
  "query-string": "7.1.3",
44
44
  "shaka-player": "4.3.5",
45
45
  "typeface-montserrat": "^0.0.54",
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import { StyleSheet } from "react-native";
2
+ import { StyleSheet, View } from "react-native";
3
3
 
4
4
  import { dayjs } from "@applicaster/zapp-react-native-utils/dateUtils";
5
5
  import {
@@ -12,11 +12,6 @@ import {
12
12
  } from "@applicaster/quick-brick-mobile-transport-controls";
13
13
  import { playerManager } from "@applicaster/zapp-react-native-utils/appUtils";
14
14
 
15
- import {
16
- AnimationComponent,
17
- ComponentAnimationType,
18
- } from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation";
19
-
20
15
  import { AudioDescription } from "../../AudioDescription";
21
16
  import { isValidDate } from "../../../Utils";
22
17
  import { VerticalGutter } from "./VerticalGutter";
@@ -103,8 +98,6 @@ export const Controls = (props: Props) => {
103
98
  onSkipLive,
104
99
  onSpeedButtonPress,
105
100
  maxWidth = 320,
106
-
107
- docked,
108
101
  } = props;
109
102
 
110
103
  const configuration = useZStore("playerConfiguration");
@@ -229,15 +222,8 @@ export const Controls = (props: Props) => {
229
222
  isLiveShowFullControls,
230
223
  ]);
231
224
 
232
- if (docked) {
233
- return null;
234
- }
235
-
236
225
  return (
237
- <AnimationComponent
238
- animationType={ComponentAnimationType.componentFade}
239
- style={isTablet ? styles.nonFlex : styles.flex}
240
- >
226
+ <View style={isTablet ? styles.nonFlex : styles.flex}>
241
227
  <VerticalGutter />
242
228
 
243
229
  <AudioDescription
@@ -257,7 +243,11 @@ export const Controls = (props: Props) => {
257
243
  content={entry}
258
244
  value={value}
259
245
  visible
260
- layoutState={layoutState}
246
+ layoutState={{
247
+ ...layoutState,
248
+ docked: false, // always use non-docked layout for audio (to show time labels
249
+ inline: true, // always use inline layout for audio (to show time labels)
250
+ }}
261
251
  onPlayerSeek={onPlayerSeek}
262
252
  playerState={playerState}
263
253
  disableFullscreen
@@ -286,6 +276,6 @@ export const Controls = (props: Props) => {
286
276
  }}
287
277
  playerState={playerState}
288
278
  />
289
- </AnimationComponent>
279
+ </View>
290
280
  );
291
281
  };
@@ -18,12 +18,15 @@ import { PlayNextData } from "@applicaster/zapp-react-native-ui-components/Compo
18
18
 
19
19
  import { toNumberWithDefault } from "@applicaster/zapp-react-native-utils/numberUtils";
20
20
  import { useSafeAreaInsets } from "react-native-safe-area-context";
21
+ import { useNavigation } from "@applicaster/zapp-react-native-utils/reactHooks/navigation/useNavigation";
21
22
  import { getTabBarHeight } from "@applicaster/zapp-react-native-utils/reactHooks/navigation/getTabBarHeight";
22
23
  import { useTitleSummaryOverlay } from "@applicaster/zapp-react-native-utils/appUtils/playerManager/usePlayerTitleSummaryOverlay";
23
24
  import { usePlayerState } from "@applicaster/zapp-react-native-utils/appUtils/playerManager/usePlayerState";
24
25
  import { useConfiguration } from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/utils";
25
26
  import { noop } from "@applicaster/zapp-react-native-utils/functionUtils";
26
27
  import { PROGRESS_BAR_HEIGHT } from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation/utils";
28
+ import { isMenuVisible } from "@applicaster/zapp-react-native-ui-components/Components/Screen/navigationHandler";
29
+ import { usePlugins } from "@applicaster/zapp-react-native-redux";
27
30
 
28
31
  const bottomTabBarHeight = getTabBarHeight();
29
32
 
@@ -172,6 +175,10 @@ export const DockedControls = (props: Props) => {
172
175
  playerManager.close();
173
176
  }, []);
174
177
 
178
+ const { currentRoute, screenData } = useNavigation();
179
+
180
+ const menuVisible = isMenuVisible(currentRoute, screenData, usePlugins);
181
+
175
182
  const { minimised_height: minimisedHeight } = useConfiguration();
176
183
 
177
184
  const configuration = useZStore("playerConfiguration")();
@@ -220,7 +227,10 @@ export const DockedControls = (props: Props) => {
220
227
  style={[
221
228
  styles.container,
222
229
  {
223
- height: minimisedHeight + bottomTabBarHeight + insets.bottom,
230
+ height:
231
+ minimisedHeight +
232
+ (menuVisible ? bottomTabBarHeight : 0) +
233
+ insets.bottom,
224
234
  },
225
235
  ]}
226
236
  >
@@ -295,7 +305,7 @@ export const DockedControls = (props: Props) => {
295
305
  </View>
296
306
  <View
297
307
  style={{
298
- height: insets.bottom + bottomTabBarHeight,
308
+ height: insets.bottom + (menuVisible ? bottomTabBarHeight : 0),
299
309
  backgroundColor: dockedBackgroundColor,
300
310
  }}
301
311
  />
@@ -1,18 +1,21 @@
1
+ import { useCallback, useEffect, useMemo, useRef } from "react";
2
+ import { useSafeAreaInsets } from "react-native-safe-area-context";
3
+ import { State } from "react-native-gesture-handler";
4
+ import { Animated } from "react-native";
5
+
1
6
  import { VideoModalMode } from "@applicaster/zapp-react-native-ui-components/Components/PlayerContainer/PlayerContainer";
2
7
  import { useConfiguration } from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/utils";
3
8
  import { getTabBarHeight } from "@applicaster/zapp-react-native-utils/reactHooks/navigation/getTabBarHeight";
4
9
  import { useNavigation } from "@applicaster/zapp-react-native-utils/reactHooks/navigation/useNavigation";
5
- import { useCallback, useEffect, useMemo, useRef } from "react";
6
- import { useSafeAreaInsets } from "react-native-safe-area-context";
10
+ import { isMenuVisible } from "@applicaster/zapp-react-native-ui-components/Components/Screen/navigationHandler";
7
11
  import {
8
12
  ANIMATION_DURATION,
9
13
  DRAG_TO_COLLAPSE,
10
14
  DRAG_TO_EXPAND,
11
15
  SCREEN_HEIGHT,
12
16
  } from "../consts";
13
- import { State } from "react-native-gesture-handler";
14
- import { Animated } from "react-native";
15
17
  import { PROGRESS_BAR_HEIGHT } from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation/utils";
18
+ import { usePlugins } from "@applicaster/zapp-react-native-redux";
16
19
 
17
20
  const bottomTabBarHeight = getTabBarHeight();
18
21
 
@@ -21,15 +24,25 @@ export const useVideoModalState = (
21
24
  ) => {
22
25
  const { minimised_height: minimisedHeight } = useConfiguration();
23
26
 
24
- const { maximiseVideoModal, minimiseVideoModal, videoModalState } =
25
- useNavigation();
27
+ const {
28
+ maximiseVideoModal,
29
+ minimiseVideoModal,
30
+ videoModalState,
31
+ currentRoute,
32
+ screenData,
33
+ } = useNavigation();
34
+
35
+ const menuVisible = isMenuVisible(currentRoute, screenData, usePlugins);
26
36
 
27
37
  const collapsed = videoModalState.mode === VideoModalMode.MINIMIZED;
28
38
 
29
39
  const { bottom } = useSafeAreaInsets();
30
40
 
31
41
  const collapsedHeight =
32
- minimisedHeight + bottom + bottomTabBarHeight + PROGRESS_BAR_HEIGHT;
42
+ minimisedHeight +
43
+ bottom +
44
+ (menuVisible ? bottomTabBarHeight : 0) +
45
+ PROGRESS_BAR_HEIGHT;
33
46
 
34
47
  const translateY = translateYRef.current;
35
48
 
@@ -58,74 +71,80 @@ export const useVideoModalState = (
58
71
  const offset = useRef(SCREEN_HEIGHT - collapsedHeight);
59
72
 
60
73
  // Gesture handler for modal
61
- const onGestureEvent = (event: any) => {
62
- if (event.nativeEvent.state === State.ACTIVE) {
63
- const y = event.nativeEvent.translationY;
64
- let newY = offset.current + y;
65
- if (newY < 0) newY = 0;
66
-
67
- if (newY > SCREEN_HEIGHT - collapsedHeight) {
68
- newY = SCREEN_HEIGHT - collapsedHeight;
69
- }
70
-
71
- translateY.setValue(newY);
72
- }
73
- };
74
-
75
- const onHandlerStateChange = (event: any) => {
76
- if (event.nativeEvent.oldState === State.ACTIVE) {
77
- const { translationY } = event.nativeEvent;
78
- let newY = offset.current + translationY;
79
- if (newY < 0) newY = 0;
80
-
81
- if (newY > SCREEN_HEIGHT - collapsedHeight) {
82
- newY = SCREEN_HEIGHT - collapsedHeight;
74
+ const onGestureEvent = useCallback(
75
+ (event: any) => {
76
+ if (event.nativeEvent.state === State.ACTIVE) {
77
+ const y = event.nativeEvent.translationY;
78
+ let newY = offset.current + y;
79
+ if (newY < 0) newY = 0;
80
+
81
+ if (newY > SCREEN_HEIGHT - collapsedHeight) {
82
+ newY = SCREEN_HEIGHT - collapsedHeight;
83
+ }
84
+
85
+ translateY.setValue(newY);
83
86
  }
87
+ },
88
+ [collapsedHeight, translateY]
89
+ );
84
90
 
85
- const shouldCollapse =
86
- translationY > (SCREEN_HEIGHT - collapsedHeight) * DRAG_TO_COLLAPSE;
87
-
88
- const shouldExpand =
89
- translationY < -(SCREEN_HEIGHT - collapsedHeight) * DRAG_TO_EXPAND;
90
-
91
- if (!collapsed && shouldCollapse) {
92
- // Collapse
93
- Animated.timing(translateY, {
94
- toValue: SCREEN_HEIGHT - collapsedHeight,
95
- duration: ANIMATION_DURATION,
96
- useNativeDriver: true,
97
- }).start(() => {
98
- minimiseVideoModal();
99
- offset.current = SCREEN_HEIGHT - collapsedHeight;
100
- });
101
- } else if (collapsed && shouldExpand) {
102
- // Expand
103
- Animated.timing(translateY, {
104
- toValue: 0,
105
- duration: ANIMATION_DURATION,
106
- useNativeDriver: true,
107
- }).start(() => {
108
- maximiseVideoModal();
109
- offset.current = 0;
110
- translateY.setValue(0);
111
- });
112
- } else {
113
- // Snap back to current state
114
- Animated.spring(translateY, {
115
- toValue: collapsed ? SCREEN_HEIGHT - collapsedHeight : 0,
116
- useNativeDriver: true,
117
- }).start(() => {
118
- offset.current = collapsed ? SCREEN_HEIGHT - collapsedHeight : 0;
119
- translateY.setValue(offset.current);
91
+ const onHandlerStateChange = useCallback(
92
+ (event: any) => {
93
+ if (event.nativeEvent.oldState === State.ACTIVE) {
94
+ const { translationY } = event.nativeEvent;
95
+ let newY = offset.current + translationY;
96
+ if (newY < 0) newY = 0;
97
+
98
+ if (newY > SCREEN_HEIGHT - collapsedHeight) {
99
+ newY = SCREEN_HEIGHT - collapsedHeight;
100
+ }
101
+
102
+ const shouldCollapse =
103
+ translationY > (SCREEN_HEIGHT - collapsedHeight) * DRAG_TO_COLLAPSE;
104
+
105
+ const shouldExpand =
106
+ translationY < -(SCREEN_HEIGHT - collapsedHeight) * DRAG_TO_EXPAND;
107
+
108
+ if (!collapsed && shouldCollapse) {
109
+ // Collapse
110
+ Animated.timing(translateY, {
111
+ toValue: SCREEN_HEIGHT - collapsedHeight,
112
+ duration: ANIMATION_DURATION,
113
+ useNativeDriver: true,
114
+ }).start(() => {
115
+ minimiseVideoModal();
116
+ offset.current = SCREEN_HEIGHT - collapsedHeight;
117
+ });
118
+ } else if (collapsed && shouldExpand) {
119
+ // Expand
120
+ Animated.timing(translateY, {
121
+ toValue: 0,
122
+ duration: ANIMATION_DURATION,
123
+ useNativeDriver: true,
124
+ }).start(() => {
125
+ maximiseVideoModal();
126
+ offset.current = 0;
127
+ translateY.setValue(0);
128
+ });
129
+ } else {
130
+ // Snap back to current state
131
+ Animated.spring(translateY, {
132
+ toValue: collapsed ? SCREEN_HEIGHT - collapsedHeight : 0,
133
+ useNativeDriver: true,
134
+ }).start(() => {
135
+ offset.current = collapsed ? SCREEN_HEIGHT - collapsedHeight : 0;
136
+ translateY.setValue(offset.current);
137
+ });
138
+ }
139
+ } else if (event.nativeEvent.state === State.BEGAN) {
140
+ // Gesture started, set offset
141
+ translateY.stopAnimation((value: number) => {
142
+ offset.current = value;
120
143
  });
121
144
  }
122
- } else if (event.nativeEvent.state === State.BEGAN) {
123
- // Gesture started, set offset
124
- translateY.stopAnimation((value: number) => {
125
- offset.current = value;
126
- });
127
- }
128
- };
145
+ },
146
+ [collapsedHeight, translateY]
147
+ );
129
148
 
130
149
  const gestureHandlerProps = useMemo(() => {
131
150
  return {
@@ -148,14 +167,23 @@ export const useVideoModalState = (
148
167
  translateY.setValue(SCREEN_HEIGHT - collapsedHeight);
149
168
  });
150
169
  }
151
- }, [videoModalState.visible, videoModalState.mode]);
152
-
153
- return {
154
- collapsed,
155
- collapsedHeight,
156
- offset,
157
- gestureHandlerProps,
158
- translateY,
159
- expand: maximiseVideoModal,
160
- };
170
+ }, [videoModalState.visible, videoModalState.mode, collapsedHeight]);
171
+
172
+ return useMemo(
173
+ () => ({
174
+ collapsed,
175
+ collapsedHeight,
176
+ offset,
177
+ gestureHandlerProps,
178
+ translateY,
179
+ expand: maximiseVideoModal,
180
+ }),
181
+ [
182
+ collapsed,
183
+ collapsedHeight,
184
+ gestureHandlerProps,
185
+ translateY,
186
+ maximiseVideoModal,
187
+ ]
188
+ );
161
189
  };
@@ -52,50 +52,52 @@ export const useStyles = ({ height }: { height: number }) => {
52
52
  const BG_COLOR_DEFAULT_BLACK = "black";
53
53
  const BG_COLOR_DEFAULT_TRANSPARENT = "transparent";
54
54
 
55
- const styles = StyleSheet.create({
56
- modal: {
57
- position: "absolute",
58
- left: 0,
59
- right: 0,
60
- top: 0,
61
- backgroundColor,
62
- elevation: 10,
63
- zIndex: 100,
64
- overflow: "hidden",
65
- },
66
- modalWrapper: {
67
- backgroundColor: BG_COLOR_DEFAULT_BLACK,
68
- },
69
- collapsedModalBg: {
70
- backgroundColor: BG_COLOR_DEFAULT_BLACK,
71
- },
72
- modalContent: {
73
- flex: 1,
74
- alignItems: "center",
75
- },
76
- expandedContentContainer: {
77
- justifyContent: "flex-start",
78
- backgroundColor: BG_COLOR_DEFAULT_TRANSPARENT,
79
- zIndex: 1,
80
- flex: 0,
81
- },
82
- extraContentScrollView: {
83
- width: "100%",
84
- backgroundColor: BG_COLOR_DEFAULT_TRANSPARENT,
85
- },
86
- collapsedBarContainer: {
87
- ...StyleSheet.absoluteFillObject,
88
- height: COLLAPSED_HEIGHT,
89
- justifyContent: "flex-end",
90
- },
91
- collapsedBarWrapper: {
92
- flex: 1,
93
- },
94
- flexNone: {
95
- ...StyleSheet.absoluteFillObject,
96
- flex: -1,
97
- },
98
- });
99
-
100
- return useMemo(() => styles, [styles]);
55
+ return useMemo(
56
+ () =>
57
+ StyleSheet.create({
58
+ modal: {
59
+ position: "absolute",
60
+ left: 0,
61
+ right: 0,
62
+ top: 0,
63
+ backgroundColor,
64
+ elevation: 10,
65
+ zIndex: 100,
66
+ overflow: "hidden",
67
+ },
68
+ modalWrapper: {
69
+ backgroundColor: BG_COLOR_DEFAULT_BLACK,
70
+ },
71
+ collapsedModalBg: {
72
+ backgroundColor: BG_COLOR_DEFAULT_BLACK,
73
+ },
74
+ modalContent: {
75
+ flex: 1,
76
+ alignItems: "center",
77
+ },
78
+ expandedContentContainer: {
79
+ justifyContent: "flex-start",
80
+ backgroundColor: BG_COLOR_DEFAULT_TRANSPARENT,
81
+ zIndex: 1,
82
+ flex: 0,
83
+ },
84
+ extraContentScrollView: {
85
+ width: "100%",
86
+ backgroundColor: BG_COLOR_DEFAULT_TRANSPARENT,
87
+ },
88
+ collapsedBarContainer: {
89
+ ...StyleSheet.absoluteFillObject,
90
+ height: COLLAPSED_HEIGHT,
91
+ justifyContent: "flex-end",
92
+ },
93
+ collapsedBarWrapper: {
94
+ flex: 1,
95
+ },
96
+ flexNone: {
97
+ ...StyleSheet.absoluteFillObject,
98
+ flex: -1,
99
+ },
100
+ }),
101
+ [backgroundColor, COLLAPSED_HEIGHT]
102
+ );
101
103
  };