@applicaster/quick-brick-player 13.0.0-alpha.1244047241 → 13.0.0-alpha.1290120403

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": "13.0.0-alpha.1244047241",
3
+ "version": "13.0.0-alpha.1290120403",
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": "13.0.0-rc.120",
38
+ "@applicaster/quick-brick-mobile-transport-controls": "13.0.0-rc.112",
39
39
  "@applicaster/quick-brick-tv-transport-controls": "13.0.0-rc.56",
40
- "@applicaster/zapp-react-native-tvos-app": "13.0.0-alpha.1244047241",
41
- "@applicaster/zapp-react-native-ui-components": "13.0.0-alpha.1244047241",
42
- "@applicaster/zapp-react-native-utils": "13.0.0-alpha.1244047241",
40
+ "@applicaster/zapp-react-native-tvos-app": "13.0.0-alpha.1290120403",
41
+ "@applicaster/zapp-react-native-ui-components": "13.0.0-alpha.1290120403",
42
+ "@applicaster/zapp-react-native-utils": "13.0.0-alpha.1290120403",
43
43
  "query-string": "7.1.3",
44
44
  "react-native-web-linear-gradient": "1.1.2",
45
45
  "shaka-player": "4.3.5",
@@ -113,7 +113,7 @@ export const AudioDescription = (props: AudioDescriptionProps) => {
113
113
  style={[
114
114
  styles.wrapper,
115
115
  {
116
- maxWidth: Math.max(maxWidth, 320),
116
+ maxWidth,
117
117
  height,
118
118
  },
119
119
  ]}
@@ -43,11 +43,7 @@ import {
43
43
  SleepTimerState,
44
44
  } from "./SleepTimerManager";
45
45
  import { DEFAULT_SPEED, PlaybackSpeed, SpeedController } from "./SpeedManager";
46
- import {
47
- dismissModal as dismissBottomSheetModal,
48
- openBottomSheetModal,
49
- useModalStoreState,
50
- } from "@applicaster/zapp-react-native-utils/modalState";
46
+ import { openBottomSheetModal } from "@applicaster/zapp-react-native-utils/modalState";
51
47
  import { getSleepTimerOptions } from "../Const/sleepTimerOptions";
52
48
  import { speedOptions } from "../Const/speedOptions";
53
49
 
@@ -65,6 +61,7 @@ type Dimensions = {
65
61
 
66
62
  type Configuration = {
67
63
  [key: string]: any;
64
+ audio_player_background_image_query?: string;
68
65
  audio_player_background_image_default_color?: string;
69
66
  tablet_landscape_sidebar_width?: string;
70
67
  tablet_landscape_player_container_background_color?: string;
@@ -106,8 +103,6 @@ export const AudioPlayerWrapper: React.FC<Props> = (props: Props) => {
106
103
  const player = usePlayer();
107
104
  const playerState = usePlayerState("audio-player-wrapper");
108
105
 
109
- const modalBottomSheetState = useModalStoreState();
110
-
111
106
  const {
112
107
  configuration,
113
108
  style,
@@ -145,31 +140,6 @@ export const AudioPlayerWrapper: React.FC<Props> = (props: Props) => {
145
140
  }
146
141
  }, [player]);
147
142
 
148
- useEffect(() => {
149
- if (!player) return;
150
-
151
- const unsubscribe = player.addListener({
152
- id: "audio-player-wrapper-bottom-sheet-modal",
153
- listener: {
154
- onVideoEnd: () => {
155
- // Dismiss the bottom sheet modal when the video ends to avoid audio breaks and app freeze
156
- if (modalBottomSheetState.visible) {
157
- dismissBottomSheetModal();
158
- }
159
- },
160
- },
161
- });
162
-
163
- return () => unsubscribe?.();
164
- }, [player, modalBottomSheetState.visible, sleepTimerManager]);
165
-
166
- React.useEffect(() => {
167
- if (playerState?.isLive) {
168
- // Resetting a sleep timer when audio content is live (Timer not supported on live video)
169
- sleepTimerManager.setSleepTimer(SLEEP_TIMER_OFF).catch();
170
- }
171
- }, [playerState?.isLive]);
172
-
173
143
  const [playbackSpeed, setPlaybackSpeed] =
174
144
  useState<PlaybackSpeed>(DEFAULT_SPEED);
175
145
 
@@ -24,7 +24,6 @@ import {
24
24
  useModalAnimationContext,
25
25
  } from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation";
26
26
  import { toNumberWithDefault } from "@applicaster/zapp-react-native-utils/numberUtils";
27
- import { useSafeAreaInsets } from "react-native-safe-area-context";
28
27
 
29
28
  type Props = {
30
29
  entry: ZappEntry;
@@ -89,6 +88,10 @@ const styles = StyleSheet.create({
89
88
  },
90
89
  });
91
90
 
91
+ const backgroundColorStyle = (value: GetValue): ViewStyle => ({
92
+ backgroundColor: value("docked_player_background_color"),
93
+ });
94
+
92
95
  const playerDimensionsStyle = (
93
96
  minimisedHeight: number,
94
97
  addPadding: boolean
@@ -205,10 +208,6 @@ export const DockedControls = (props: Props) => {
205
208
  []
206
209
  );
207
210
 
208
- const dockedBackgroundColor = value("docked_player_background_color");
209
-
210
- const insets = useSafeAreaInsets();
211
-
212
211
  if (!layoutState.docked && !startComponentsAnimation) return null;
213
212
 
214
213
  return (
@@ -220,9 +219,7 @@ export const DockedControls = (props: Props) => {
220
219
  isActiveGesture || layoutState.docked,
221
220
  progressBarHeight
222
221
  ),
223
- {
224
- height: minimisedHeight + insets.bottom,
225
- },
222
+ { height: minimisedHeight },
226
223
  ]}
227
224
  >
228
225
  {!playerState.isLive &&
@@ -264,12 +261,7 @@ export const DockedControls = (props: Props) => {
264
261
  )}
265
262
  />
266
263
  )}
267
- <View
268
- style={[
269
- styles.contentInfo,
270
- { backgroundColor: dockedBackgroundColor },
271
- ]}
272
- >
264
+ <View style={[styles.contentInfo, backgroundColorStyle(value)]}>
273
265
  <ContentInfo
274
266
  content={{ ...entry, title, summary }}
275
267
  value={value}
@@ -283,7 +275,7 @@ export const DockedControls = (props: Props) => {
283
275
  isTablet
284
276
  ? styles.controlsContainerForTablet
285
277
  : styles.controlsContainerForMobile,
286
- { backgroundColor: dockedBackgroundColor },
278
+ backgroundColorStyle(value),
287
279
  ]}
288
280
  >
289
281
  <Controls
@@ -305,12 +297,6 @@ export const DockedControls = (props: Props) => {
305
297
  />
306
298
  </View>
307
299
  </View>
308
- <View
309
- style={{
310
- height: insets.bottom,
311
- backgroundColor: dockedBackgroundColor,
312
- }}
313
- />
314
300
  </AnimationComponent>
315
301
  );
316
302
  };
@@ -1,5 +1,11 @@
1
1
  import React, { PropsWithChildren } from "react";
2
- import { Image, Animated, StyleSheet, ImageStyle } from "react-native";
2
+ import {
3
+ Image,
4
+ Animated,
5
+ StyleSheet,
6
+ ViewStyle,
7
+ ImageStyle,
8
+ } from "react-native";
3
9
 
4
10
  import { imageSrcFromMediaItem } from "@applicaster/zapp-react-native-utils/configurationUtils";
5
11
  import {
@@ -20,10 +26,16 @@ const styles = StyleSheet.create({
20
26
  type Props = PropsWithChildren<{
21
27
  entry: ZappEntry;
22
28
  style?: ImageStyle | ImageStyle[];
29
+ wrapperViewStyle?: ViewStyle;
23
30
  imageWidth: number;
24
31
  }>;
25
32
 
26
- export const AnimatedImage = ({ entry, style, imageWidth }: Props) => {
33
+ export const AnimatedImage = ({
34
+ entry,
35
+ style,
36
+ wrapperViewStyle,
37
+ imageWidth,
38
+ }: Props) => {
27
39
  const heightAnim = React.useRef(new Animated.Value(imageWidth)).current;
28
40
 
29
41
  const source = React.useMemo(
@@ -59,6 +71,7 @@ export const AnimatedImage = ({ entry, style, imageWidth }: Props) => {
59
71
  <Animated.View
60
72
  style={[
61
73
  styles.container,
74
+ wrapperViewStyle,
62
75
  {
63
76
  width: heightAnim,
64
77
  },
@@ -81,10 +81,7 @@ export const PlayerImage = (props: Props) => {
81
81
  >
82
82
  <View
83
83
  onLayout={onLayoutImage}
84
- style={[
85
- shouldShowShadow ? styles.shadow : undefined,
86
- { borderRadius },
87
- ]}
84
+ style={shouldShowShadow ? styles.shadow : undefined}
88
85
  >
89
86
  {!imageWidth ? (
90
87
  <View style={[styles.defaultImageWrapperView, { borderRadius }]}>
@@ -1,6 +1,4 @@
1
- /* eslint-disable react-native/no-color-literals */
2
1
  import { StyleSheet } from "react-native";
3
- import { platformSelect } from "@applicaster/zapp-react-native-utils/reactUtils";
4
2
 
5
3
  const SHADOW_COLOR = "rgba(0, 0, 0, 1)";
6
4
 
@@ -23,13 +21,9 @@ export const styles = StyleSheet.create({
23
21
  overflow: "hidden",
24
22
  },
25
23
  shadow: {
26
- borderColor: "transparent",
27
24
  shadowColor: SHADOW_COLOR,
28
25
  shadowOffset: { width: 0, height: 24 },
29
- shadowOpacity: platformSelect({
30
- ios: 0.35,
31
- default: 0.2,
32
- }),
26
+ shadowOpacity: 0.2,
33
27
  shadowRadius: 32,
34
28
  elevation: 12,
35
29
  },
@@ -42,7 +42,6 @@ const styles = StyleSheet.create({
42
42
  audioPlayerContainer: {
43
43
  flexDirection: "column",
44
44
  alignItems: "center",
45
- justifyContent: "center",
46
45
  minWidth: MIN_WIDTH,
47
46
 
48
47
  ...withDebug({
@@ -50,9 +49,6 @@ const styles = StyleSheet.create({
50
49
  borderColor: "blue",
51
50
  }),
52
51
  },
53
- audioPlayerContainerHeightLimit: {
54
- maxHeight: 750,
55
- },
56
52
  audioPlayerContainerPaddings: {
57
53
  paddingBottom: MAX_SPACING,
58
54
  paddingTop: MAX_SPACING,
@@ -148,57 +144,55 @@ export function TabletLandscapeLayout({
148
144
  : styles.audioPlayerContainerPaddings,
149
145
  ]}
150
146
  >
151
- <View style={[styles.flex, styles.audioPlayerContainerHeightLimit]}>
152
- {/* PlayerImage non-docked */}
153
- <View style={[styles.flex, withDebug(styles.debugYellow)]}>
154
- {!docked ? (
155
- <PlayerImage
156
- docked={false}
157
- entry={entry}
158
- layoutState={layoutState}
159
- playerState={playerState}
160
- value={value}
161
- configuration={configuration}
162
- onPlayerSeek={onPlayerSeek}
163
- onCloseVideoModal={onCloseVideoModal}
164
- dimensions={dimensions}
165
- playNextData={playNextData}
166
- title={title}
167
- summary={summary}
168
- verticalOffset={withAdditionalOffset({
169
- progressBarHeight,
170
- bottomInset,
171
- })}
172
- onLayoutImage={onLayoutImage}
173
- />
174
- ) : null}
175
- </View>
176
- {/* PlayerImage */}
177
-
178
- <View style={styles.controlsContainer}>
179
- <Controls
180
- maxWidth={imageWidth}
147
+ {/* PlayerImage non-docked */}
148
+ <View style={[styles.flex, withDebug(styles.debugYellow)]}>
149
+ {!docked ? (
150
+ <PlayerImage
151
+ docked={false}
181
152
  entry={entry}
182
153
  layoutState={layoutState}
183
154
  playerState={playerState}
184
155
  value={value}
156
+ configuration={configuration}
157
+ onPlayerSeek={onPlayerSeek}
158
+ onCloseVideoModal={onCloseVideoModal}
159
+ dimensions={dimensions}
160
+ playNextData={playNextData}
185
161
  title={title}
186
162
  summary={summary}
187
- sleepTimerDate={sleepTimerDate}
188
- cancelSleepTimer={cancelSleepTimer}
189
- playbackSpeedName={playbackSpeedName}
190
- playbackSleepName={playbackSleepName}
191
- onPlaybackButtonPress={onPlaybackButtonPress}
192
- onRewindButtonPress={onRewindButtonPress}
193
- onForwardButtonPress={onForwardButtonPress}
194
- onPlayerSeek={onPlayerSeek}
195
- onSkipStart={onSkipStart}
196
- onSkipLive={onSkipLive}
197
- onSpeedButtonPress={onSpeedButtonPress}
198
- onSleepButtonPress={onSleepButtonPress}
199
- docked={docked}
163
+ verticalOffset={withAdditionalOffset({
164
+ progressBarHeight,
165
+ bottomInset,
166
+ })}
167
+ onLayoutImage={onLayoutImage}
200
168
  />
201
- </View>
169
+ ) : null}
170
+ </View>
171
+ {/* PlayerImage */}
172
+
173
+ <View style={styles.controlsContainer}>
174
+ <Controls
175
+ maxWidth={imageWidth}
176
+ entry={entry}
177
+ layoutState={layoutState}
178
+ playerState={playerState}
179
+ value={value}
180
+ title={title}
181
+ summary={summary}
182
+ sleepTimerDate={sleepTimerDate}
183
+ cancelSleepTimer={cancelSleepTimer}
184
+ playbackSpeedName={playbackSpeedName}
185
+ playbackSleepName={playbackSleepName}
186
+ onPlaybackButtonPress={onPlaybackButtonPress}
187
+ onRewindButtonPress={onRewindButtonPress}
188
+ onForwardButtonPress={onForwardButtonPress}
189
+ onPlayerSeek={onPlayerSeek}
190
+ onSkipStart={onSkipStart}
191
+ onSkipLive={onSkipLive}
192
+ onSpeedButtonPress={onSpeedButtonPress}
193
+ onSleepButtonPress={onSleepButtonPress}
194
+ docked={docked}
195
+ />
202
196
  </View>
203
197
  </View>
204
198
 
@@ -26,7 +26,7 @@ export const useIsCasting = () => {
26
26
 
27
27
  React.useEffect(() => {
28
28
  if (!shouldOnlyUpdateInForeground || isAppInForeground) {
29
- if (actionContext && castActionState === null) {
29
+ if (!(!actionContext && castActionState !== null)) {
30
30
  setCastActionState(actionContext.initialEntryState(fakeEntry));
31
31
  }
32
32
  }