@applicaster/quick-brick-player 14.0.0-alpha.9119252693 → 14.0.0-alpha.9256258513

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.9119252693",
3
+ "version": "14.0.0-alpha.9256258513",
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-alpha.9119252693",
39
- "@applicaster/quick-brick-tv-transport-controls": "14.0.0-rc.31",
40
- "@applicaster/zapp-react-native-tvos-app": "14.0.0-alpha.9119252693",
41
- "@applicaster/zapp-react-native-ui-components": "14.0.0-alpha.9119252693",
42
- "@applicaster/zapp-react-native-utils": "14.0.0-alpha.9119252693",
38
+ "@applicaster/quick-brick-mobile-transport-controls": "14.0.0-alpha.9256258513",
39
+ "@applicaster/quick-brick-tv-transport-controls": "14.0.0-alpha.9256258513",
40
+ "@applicaster/zapp-react-native-tvos-app": "14.0.0-alpha.9256258513",
41
+ "@applicaster/zapp-react-native-ui-components": "14.0.0-alpha.9256258513",
42
+ "@applicaster/zapp-react-native-utils": "14.0.0-alpha.9256258513",
43
43
  "query-string": "7.1.3",
44
44
  "shaka-player": "4.3.5",
45
45
  "typeface-montserrat": "^0.0.54",
@@ -23,6 +23,7 @@ import { useTitleSummaryOverlay } from "@applicaster/zapp-react-native-utils/app
23
23
  import { usePlayerState } from "@applicaster/zapp-react-native-utils/appUtils/playerManager/usePlayerState";
24
24
  import { useConfiguration } from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/utils";
25
25
  import { noop } from "@applicaster/zapp-react-native-utils/functionUtils";
26
+ import { PROGRESS_BAR_HEIGHT } from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation/utils";
26
27
 
27
28
  const bottomTabBarHeight = getTabBarHeight();
28
29
 
@@ -47,7 +48,7 @@ const styles = StyleSheet.create({
47
48
  flex: 1,
48
49
  flexDirection: "column",
49
50
  alignItems: "stretch",
50
- marginTop: 3, // from plugins/mobile-transport-controls/src/ProgressBar/layouts/DockedLayout.tsx
51
+ marginTop: PROGRESS_BAR_HEIGHT,
51
52
  },
52
53
  content: {
53
54
  flex: 1,
@@ -1,11 +1,6 @@
1
1
  import * as React from "react";
2
2
  import { StyleSheet, View } from "react-native";
3
- import {
4
- useSafeAreaFrame,
5
- useSafeAreaInsets,
6
- } from "react-native-safe-area-context";
7
- import { useModalAnimationContext } from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation";
8
- import { isApplePlatform } from "@applicaster/zapp-react-native-utils/reactUtils";
3
+ import { useSafeAreaFrame } from "react-native-safe-area-context";
9
4
 
10
5
  import { TransportInfo } from "./TransportInfo";
11
6
  import { PlayerImage } from "./PlayerImage";
@@ -17,8 +12,6 @@ import { Props } from "./types";
17
12
  import { isSmallTabletHeight as getIsSmallTabletHeight } from "./utils";
18
13
  import { NAVBAR_HEIGHT, TABLET_LANDSCAPE } from "./const";
19
14
 
20
- const isIOS = isApplePlatform();
21
-
22
15
  const MIN_WIDTH = TABLET_LANDSCAPE.MIN_WIDTH; // Minimum width for the audio player container
23
16
  const MAX_SPACING = TABLET_LANDSCAPE.MARGIN_VERTICAL; // Maximum spacing for the audio player container
24
17
  const MIN_SPACING = TABLET_LANDSCAPE.MARGIN_VERTICAL_S; // Minimum spacing for the audio player container
@@ -68,22 +61,6 @@ const styles = StyleSheet.create({
68
61
  },
69
62
  });
70
63
 
71
- const isTabletWithHomeButton = (bottomInset: number): boolean =>
72
- bottomInset === 0;
73
-
74
- const withAdditionalOffset = ({ progressBarHeight, bottomInset }) => {
75
- if (isIOS && isTabletWithHomeButton(bottomInset)) {
76
- return progressBarHeight === 0 ? 8 : progressBarHeight + 2;
77
- }
78
-
79
- if (isIOS && !isTabletWithHomeButton(bottomInset)) {
80
- return progressBarHeight === 0 ? 4 : 1;
81
- }
82
-
83
- // android
84
- return progressBarHeight === 0 ? 4 : 0.5;
85
- };
86
-
87
64
  export function TabletLandscapeLayout({
88
65
  entry,
89
66
  layoutState,
@@ -96,21 +73,16 @@ export function TabletLandscapeLayout({
96
73
  onSkipStart,
97
74
  onSkipLive,
98
75
  onSpeedButtonPress,
99
- onCloseVideoModal,
100
76
  playbackSpeedName,
101
77
  configuration,
102
- dimensions,
103
- playNextData,
104
78
  title,
105
79
  summary,
106
80
  }: Props) {
107
81
  const [imageWidth, setImageWidth] = React.useState(0);
108
82
  const { docked } = layoutState;
109
83
 
110
- const { bottom: bottomInset } = useSafeAreaInsets();
111
84
  const { height: screenHeight } = useSafeAreaFrame();
112
85
  const isSmallScreen = getIsSmallTabletHeight(screenHeight);
113
- const { progressBarHeight } = useModalAnimationContext();
114
86
 
115
87
  const onLayoutImage = React.useCallback((e) => {
116
88
  setImageWidth(e.nativeEvent.layout.width);
@@ -149,20 +121,7 @@ export function TabletLandscapeLayout({
149
121
  <PlayerImage
150
122
  docked={false}
151
123
  entry={entry}
152
- layoutState={layoutState}
153
- playerState={playerState}
154
- value={value}
155
124
  configuration={configuration}
156
- onPlayerSeek={onPlayerSeek}
157
- onCloseVideoModal={onCloseVideoModal}
158
- dimensions={dimensions}
159
- playNextData={playNextData}
160
- title={title}
161
- summary={summary}
162
- verticalOffset={withAdditionalOffset({
163
- progressBarHeight,
164
- bottomInset,
165
- })}
166
125
  onLayoutImage={onLayoutImage}
167
126
  />
168
127
  ) : null}
@@ -4,8 +4,6 @@ import {
4
4
  useSafeAreaFrame,
5
5
  useSafeAreaInsets,
6
6
  } from "react-native-safe-area-context";
7
- import { useModalAnimationContext } from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation";
8
- import { toNumberWithDefaultZero } from "@applicaster/zapp-react-native-utils/numberUtils";
9
7
 
10
8
  import { withDebug } from "./debug";
11
9
  import { TABLET_PORTRAIT } from "./const";
@@ -15,7 +13,6 @@ import { PlayerImage } from "./PlayerImage";
15
13
  import { Controls } from "./Controls";
16
14
 
17
15
  import { useTabletLayoutImageSize } from "./hooks";
18
- import { DockedControls } from "./DockedControls";
19
16
  import { VerticalGutter } from "./VerticalGutter";
20
17
 
21
18
  import { Props } from "./types";
@@ -82,11 +79,8 @@ export function TabletPortraitLayout({
82
79
  onSkipStart,
83
80
  onSkipLive,
84
81
  onSpeedButtonPress,
85
- onCloseVideoModal,
86
82
  playbackSpeedName,
87
83
  configuration,
88
- dimensions,
89
- playNextData,
90
84
  title,
91
85
  summary,
92
86
  }: Props) {
@@ -94,7 +88,6 @@ export function TabletPortraitLayout({
94
88
 
95
89
  const { bottom: bottomInset, top: topInset } = useSafeAreaInsets();
96
90
  const { height: screenHeight } = useSafeAreaFrame();
97
- const { progressBarHeight } = useModalAnimationContext();
98
91
 
99
92
  const {
100
93
  imageSize,
@@ -153,21 +146,9 @@ export function TabletPortraitLayout({
153
146
  >
154
147
  <PlayerImage
155
148
  entry={entry}
156
- layoutState={layoutState}
157
- playerState={playerState}
158
- value={value}
159
149
  configuration={configuration}
160
- onPlayerSeek={onPlayerSeek}
161
- onCloseVideoModal={onCloseVideoModal}
162
- dimensions={dimensions}
163
- playNextData={playNextData}
164
- title={title}
165
- summary={summary}
166
150
  docked={docked}
167
151
  imageWidth={imageSize}
168
- verticalOffset={
169
- toNumberWithDefaultZero(topOffset) - progressBarHeight
170
- }
171
152
  />
172
153
  </View>
173
154
 
@@ -196,20 +177,6 @@ export function TabletPortraitLayout({
196
177
  </View>
197
178
  </View>
198
179
  </View>
199
- {/* PlayerImage */}
200
-
201
- <DockedControls
202
- entry={entry}
203
- layoutState={layoutState}
204
- playerState={playerState}
205
- value={value}
206
- dimensions={dimensions}
207
- onCloseVideoModal={onCloseVideoModal}
208
- onPlayerSeek={onPlayerSeek}
209
- playNextData={playNextData}
210
- title={title}
211
- summary={summary}
212
- />
213
180
  </View>
214
181
  );
215
182
  }
@@ -96,9 +96,7 @@ export function AnimatedModal({
96
96
  >
97
97
  <Pressable
98
98
  testID="collapsedBarWrapper"
99
- onPress={() => {
100
- expand();
101
- }}
99
+ onPress={expand}
102
100
  style={styles.collapsedBarWrapper}
103
101
  >
104
102
  {collapsedContent}
@@ -11,6 +11,7 @@ import {
11
11
  MODAL_RADIUS,
12
12
  SCREEN_HEIGHT,
13
13
  SCREEN_WIDTH,
14
+ VIDEO_TRANSITION_THRESHOLD,
14
15
  } from "./consts";
15
16
  import { useIsTablet } from "@applicaster/zapp-react-native-utils/reactHooks";
16
17
  import { isTV } from "@applicaster/zapp-react-native-utils/reactUtils";
@@ -49,6 +50,8 @@ type AnimatedModalProps = {
49
50
  };
50
51
  };
51
52
 
53
+ const height = SCREEN_HEIGHT;
54
+
52
55
  export function VideoPlayerModal({
53
56
  enabled = true,
54
57
  aspectRatio = DEFAULT_IMAGE_RATIO_VIDEO,
@@ -62,11 +65,9 @@ export function VideoPlayerModal({
62
65
  const isTablet = useIsTablet();
63
66
 
64
67
  let width = SCREEN_WIDTH;
65
- let height = SCREEN_HEIGHT;
66
68
 
67
69
  if (isTablet && !isTabletPortrait) {
68
70
  width = style?.tabletLandscapeWidth || width;
69
- height = SCREEN_HEIGHT; // Keep height consistent for landscape
70
71
  }
71
72
 
72
73
  const { minimised_height: minimisedHeight } = useConfiguration();
@@ -88,8 +89,6 @@ export function VideoPlayerModal({
88
89
 
89
90
  const SCALE_FACTOR = 1 / (width / aspectRatio / minimisedHeight); // Scale factor for expanded content
90
91
 
91
- const VIDEO_TRANSITION_THRESHOLD = 0.5; // Threshold for video transition
92
-
93
92
  const insets = useSafeAreaInsets();
94
93
 
95
94
  // Interpolated opacities for smooth cross-fade
@@ -225,9 +224,7 @@ export function VideoPlayerModal({
225
224
  >
226
225
  <Pressable
227
226
  testID="collapsedBarWrapper"
228
- onPress={() => {
229
- expand();
230
- }}
227
+ onPress={expand}
231
228
  style={styles.collapsedBarWrapper}
232
229
  >
233
230
  {collapsedContent}
@@ -1,3 +1,4 @@
1
+ import { isAndroidTablet } from "@applicaster/zapp-react-native-utils/reactHooks/layout/isTablet";
1
2
  import {
2
3
  isAndroidPlatform,
3
4
  isAndroidVersionAtLeast,
@@ -6,9 +7,12 @@ import { Dimensions, StatusBar } from "react-native";
6
7
 
7
8
  export const DOCKED_PROGRESSBAR_HEIGHT = 3; // Height of the docked progress bar plugins/mobile-transport-controls/src/ProgressBar/layouts/DockedLayout.tsx
8
9
 
10
+ export const VIDEO_TRANSITION_THRESHOLD = 0.5; // Threshold for video transition
11
+
9
12
  const windowDimensions = Dimensions.get("window");
10
13
 
11
- const isOldAndroidDevice = !isAndroidVersionAtLeast(35) && isAndroidPlatform();
14
+ const isOldAndroidDevice =
15
+ isAndroidPlatform() && !isAndroidVersionAtLeast(35) && !isAndroidTablet();
12
16
 
13
17
  export const SCREEN_WIDTH = windowDimensions.width;
14
18
 
@@ -92,7 +92,7 @@ export const useVideoModalState = (
92
92
  // Collapse
93
93
  Animated.timing(translateY, {
94
94
  toValue: SCREEN_HEIGHT - collapsedHeight,
95
- duration: 250,
95
+ duration: ANIMATION_DURATION,
96
96
  useNativeDriver: true,
97
97
  }).start(() => {
98
98
  minimiseVideoModal();
@@ -102,7 +102,7 @@ export const useVideoModalState = (
102
102
  // Expand
103
103
  Animated.timing(translateY, {
104
104
  toValue: 0,
105
- duration: 250,
105
+ duration: ANIMATION_DURATION,
106
106
  useNativeDriver: true,
107
107
  }).start(() => {
108
108
  maximiseVideoModal();
@@ -80,6 +80,7 @@ export const useStyles = ({ height }: { height: number }) => {
80
80
  flex: 0,
81
81
  },
82
82
  extraContentScrollView: {
83
+ width: "100%",
83
84
  backgroundColor: BG_COLOR_DEFAULT_TRANSPARENT,
84
85
  },
85
86
  collapsedBarContainer: {