@applicaster/quick-brick-player 13.0.0-alpha.3637360334 → 13.0.0-alpha.3732093334

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.
Files changed (40) hide show
  1. package/package.json +5 -7
  2. package/src/Player/AudioLayer/AudioDescription.tsx +106 -69
  3. package/src/Player/AudioLayer/AudioPlayerWrapper.tsx +129 -201
  4. package/src/Player/AudioLayer/Layout/Controls/VerticalGutter.tsx +22 -3
  5. package/src/Player/AudioLayer/Layout/Controls/index.tsx +44 -31
  6. package/src/Player/AudioLayer/Layout/Controls/utils.ts +4 -14
  7. package/src/Player/AudioLayer/Layout/Debug/index.tsx +55 -0
  8. package/src/Player/AudioLayer/Layout/DockedControls/index.tsx +27 -25
  9. package/src/Player/AudioLayer/Layout/MobileLayout.tsx +39 -18
  10. package/src/Player/AudioLayer/Layout/PlayerImage/{ScaledImage.tsx → AnimatedImage.tsx} +14 -14
  11. package/src/Player/AudioLayer/Layout/PlayerImage/FlexImage.tsx +20 -0
  12. package/src/Player/AudioLayer/Layout/PlayerImage/index.tsx +47 -43
  13. package/src/Player/AudioLayer/Layout/PlayerImage/styles.ts +15 -0
  14. package/src/Player/AudioLayer/Layout/TabletLandscapeLayout.tsx +115 -101
  15. package/src/Player/AudioLayer/Layout/TabletPortraitLayout.tsx +12 -7
  16. package/src/Player/AudioLayer/Layout/TransportInfo/index.tsx +41 -16
  17. package/src/Player/AudioLayer/Layout/const.ts +7 -0
  18. package/src/Player/AudioLayer/Layout/debug.ts +2 -1
  19. package/src/Player/AudioLayer/Layout/hooks/index.ts +3 -1
  20. package/src/Player/AudioLayer/Layout/hooks/useMobileLayoutImageSize.ts +14 -0
  21. package/src/Player/AudioLayer/Layout/hooks/{useImageSize.ts → useTabletLayoutImageSize.ts} +23 -17
  22. package/src/Player/AudioLayer/Layout/hooks/useTransportInfoHeight.ts +1 -1
  23. package/src/Player/AudioLayer/Layout/index.tsx +6 -37
  24. package/src/Player/AudioLayer/Layout/types.ts +3 -45
  25. package/src/Player/AudioLayer/Layout/utils.ts +7 -0
  26. package/src/Player/AudioLayer/utils.ts +6 -3
  27. package/src/Player/Const/sleepTimerOptions.ts +39 -0
  28. package/src/Player/Const/speedOptions.ts +4 -0
  29. package/src/Player/Utils/Utils.ts +0 -5
  30. package/src/Player/Utils/index.tsx +117 -0
  31. package/src/Player/hooks/useIsCasting.tsx +57 -0
  32. package/src/Player/index.tsx +14 -6
  33. package/src/QuickBrickPlayer.tsx +3 -0
  34. package/src/Player/AudioLayer/Layout/PlayerImage/StaticImage.tsx +0 -32
  35. package/src/Player/AudioLayer/LinearGradient/LinearGradientProxy.ts +0 -3
  36. package/src/Player/AudioLayer/LinearGradient/LinearGradientProxy.web.ts +0 -3
  37. package/src/Player/AudioLayer/LinearGradient/index.ts +0 -1
  38. package/src/Player/AudioLayer/MagicBG/index.tsx +0 -155
  39. package/src/Player/Helpers/VideoResizeMode.ts +0 -7
  40. package/src/utils/utils.ts +0 -25
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/quick-brick-player",
3
- "version": "13.0.0-alpha.3637360334",
3
+ "version": "13.0.0-alpha.3732093334",
4
4
  "description": "Quick Brick Player",
5
5
  "main": "./src/index.ts",
6
6
  "types": "index.d.ts",
@@ -35,12 +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-alpha.3637360334",
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.3637360334",
41
- "@applicaster/zapp-react-native-ui-components": "13.0.0-alpha.3637360334",
42
- "@applicaster/zapp-react-native-utils": "13.0.0-alpha.3637360334",
43
- "keymirror": "^0.1.1",
40
+ "@applicaster/zapp-react-native-tvos-app": "13.0.0-alpha.3732093334",
41
+ "@applicaster/zapp-react-native-ui-components": "13.0.0-alpha.3732093334",
42
+ "@applicaster/zapp-react-native-utils": "13.0.0-alpha.3732093334",
44
43
  "query-string": "7.1.3",
45
44
  "react-native-web-linear-gradient": "1.1.2",
46
45
  "shaka-player": "4.3.5",
@@ -53,7 +52,6 @@
53
52
  "@applicaster/applicaster-types": "*",
54
53
  "@applicaster/blur": "*",
55
54
  "@applicaster/quick-brick-xray": "*",
56
- "@applicaster/react-native-color-thief": "*",
57
55
  "@applicaster/zapp-pipes-v2-client": "*",
58
56
  "@applicaster/zapp-react-dom-ui-components": "*",
59
57
  "@applicaster/zapp-react-native-redux": "*",
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { Text, TextStyle, View, StyleSheet } from "react-native";
2
+ import { StyleSheet, Text, TextStyle, View } from "react-native";
3
3
  import { platformSelect } from "@applicaster/zapp-react-native-utils/reactUtils";
4
4
 
5
5
  type AudioDescriptionProps = {
@@ -10,88 +10,125 @@ type AudioDescriptionProps = {
10
10
  docked: boolean;
11
11
  isModal: boolean;
12
12
  };
13
+ maxWidth?: number;
13
14
  value: GetValue;
14
15
  };
15
16
 
17
+ const TITLE_PADDING_BOTTOM = 5;
18
+ const TITLE_LINES = 2;
19
+ const SUBTITLE_LINES = 1;
20
+
16
21
  const styles = StyleSheet.create({
17
- container: {},
22
+ wrapper: {
23
+ width: "100%",
24
+ alignSelf: "center",
25
+ alignItems: "center",
26
+ justifyContent: "center",
27
+ },
28
+ titleText: {
29
+ textAlign: "center",
30
+ alignSelf: "center",
31
+ paddingBottom: TITLE_PADDING_BOTTOM,
32
+ },
33
+ summaryText: {
34
+ textAlign: "left",
35
+ alignSelf: "center",
36
+ },
18
37
  });
19
38
 
20
- const titleStyles = (value: GetValue, prefix: string): TextStyle => ({
21
- textAlign: "left",
22
- color: value(`${prefix}title_color`),
23
- alignSelf: "center",
24
- paddingBottom: 5,
25
- lineHeight:
26
- Number(
27
- platformSelect({
28
- ios: value(`${prefix}title_lineheight_ios`),
29
- android: value(`${prefix}title_lineheight_android`),
30
- })
31
- ) || 18,
32
- letterSpacing:
33
- Number(
34
- platformSelect({
35
- ios: value(`${prefix}title_letterspacing_ios`),
36
- android: value(`${prefix}title_letterspacing_android`),
37
- })
38
- ) || 0,
39
- fontSize:
40
- Number(
41
- platformSelect({
42
- ios: value(`${prefix}title_fontsize_ios`),
43
- android: value(`${prefix}title_fontsize_android`),
44
- })
45
- ) || 16,
46
- fontFamily: platformSelect({
47
- ios: value(`${prefix}title_font_ios`),
48
- android: value(`${prefix}title_font_android`),
49
- }),
50
- });
39
+ const getTitleStyles = (value: GetValue, prefix: string) =>
40
+ ({
41
+ color: value(`${prefix}title_color`),
42
+ lineHeight:
43
+ Number(
44
+ platformSelect({
45
+ ios: value(`${prefix}title_lineheight_ios`),
46
+ android: value(`${prefix}title_lineheight_android`),
47
+ })
48
+ ) || 18,
49
+ letterSpacing:
50
+ Number(
51
+ platformSelect({
52
+ ios: value(`${prefix}title_letterspacing_ios`),
53
+ android: value(`${prefix}title_letterspacing_android`),
54
+ })
55
+ ) || 0,
56
+ fontSize:
57
+ Number(
58
+ platformSelect({
59
+ ios: value(`${prefix}title_fontsize_ios`),
60
+ android: value(`${prefix}title_fontsize_android`),
61
+ })
62
+ ) || 16,
63
+ fontFamily: platformSelect({
64
+ ios: value(`${prefix}title_font_ios`),
65
+ android: value(`${prefix}title_font_android`),
66
+ }),
67
+ }) as const;
51
68
 
52
- const summaryStyles = (value: GetValue, prefix: string): TextStyle => ({
53
- textAlign: "left",
54
- color: value(`${prefix}subtitle_color`),
55
- alignSelf: "center",
56
- lineHeight:
57
- Number(
58
- platformSelect({
59
- ios: value(`${prefix}subtitle_lineheight_ios`),
60
- android: value(`${prefix}subtitle_lineheight_android`),
61
- })
62
- ) || 18,
63
- letterSpacing:
64
- Number(
65
- platformSelect({
66
- ios: value(`${prefix}subtitle_letterspacing_ios`),
67
- android: value(`${prefix}subtitle_letterspacing_android`),
68
- })
69
- ) || 0,
70
- fontSize:
71
- Number(
72
- platformSelect({
73
- ios: value(`${prefix}subtitle_fontsize_ios`),
74
- android: value(`${prefix}subtitle_fontsize_android`),
75
- })
76
- ) || 13,
77
- fontFamily: platformSelect({
78
- ios: value(`${prefix}subtitle_font_ios`),
79
- android: value(`${prefix}subtitle_font_android`),
80
- }),
81
- });
69
+ const getSummaryStyles = (value: GetValue, prefix: string): TextStyle =>
70
+ ({
71
+ color: value(`${prefix}subtitle_color`),
72
+ lineHeight:
73
+ Number(
74
+ platformSelect({
75
+ ios: value(`${prefix}subtitle_lineheight_ios`),
76
+ android: value(`${prefix}subtitle_lineheight_android`),
77
+ })
78
+ ) || 18,
79
+ letterSpacing:
80
+ Number(
81
+ platformSelect({
82
+ ios: value(`${prefix}subtitle_letterspacing_ios`),
83
+ android: value(`${prefix}subtitle_letterspacing_android`),
84
+ })
85
+ ) || 0,
86
+ fontSize:
87
+ Number(
88
+ platformSelect({
89
+ ios: value(`${prefix}subtitle_fontsize_ios`),
90
+ android: value(`${prefix}subtitle_fontsize_android`),
91
+ })
92
+ ) || 13,
93
+ fontFamily: platformSelect({
94
+ ios: value(`${prefix}subtitle_font_ios`),
95
+ android: value(`${prefix}subtitle_font_android`),
96
+ }),
97
+ }) as const;
98
+
99
+ const getHeight = (titleLineHeight: number, subtitleLineHeight) =>
100
+ titleLineHeight * TITLE_LINES + subtitleLineHeight + TITLE_PADDING_BOTTOM;
82
101
 
83
102
  export const AudioDescription = (props: AudioDescriptionProps) => {
84
- const { title, summary, layoutState, value } = props;
103
+ const { title, summary, layoutState, value, maxWidth } = props;
85
104
  const prefix = layoutState.docked ? "docked_player_" : "";
86
105
 
106
+ const summaryStyles = getSummaryStyles(value, prefix);
107
+ const titleStyles = getTitleStyles(value, prefix);
108
+
109
+ const height = getHeight(titleStyles.lineHeight, summaryStyles.lineHeight);
110
+
87
111
  return (
88
- <View style={styles.container}>
89
- <Text style={titleStyles(value, prefix)} numberOfLines={1}>
112
+ <View
113
+ style={[
114
+ styles.wrapper,
115
+ {
116
+ maxWidth: Math.max(maxWidth, 320),
117
+ height,
118
+ },
119
+ ]}
120
+ >
121
+ <Text style={[styles.titleText, titleStyles]} numberOfLines={TITLE_LINES}>
90
122
  {title}
91
123
  </Text>
92
- <Text style={summaryStyles(value, prefix)} numberOfLines={1}>
93
- {summary}
94
- </Text>
124
+ {summary ? (
125
+ <Text
126
+ style={[styles.summaryText, summaryStyles]}
127
+ numberOfLines={SUBTITLE_LINES}
128
+ >
129
+ {summary}
130
+ </Text>
131
+ ) : null}
95
132
  </View>
96
133
  );
97
134
  };
@@ -1,7 +1,13 @@
1
1
  import * as React from "react";
2
- import { ViewStyle, View, Dimensions as ScreenDimensions } from "react-native";
2
+ import { useEffect, useState } from "react";
3
+ import {
4
+ Dimensions as ScreenDimensions,
5
+ StyleSheet,
6
+ View,
7
+ ViewStyle,
8
+ } from "react-native";
3
9
 
4
- import { SafeAreaView, Edge } from "react-native-safe-area-context";
10
+ import { Edge, SafeAreaView } from "react-native-safe-area-context";
5
11
  import { usePlayerState } from "@applicaster/zapp-react-native-utils/appUtils/playerManager/usePlayerState";
6
12
  import { usePlayer } from "@applicaster/zapp-react-native-utils/appUtils/playerManager/usePlayer";
7
13
  import * as R from "ramda";
@@ -15,33 +21,35 @@ import { createLogger } from "@applicaster/zapp-react-native-utils/logger";
15
21
  import { PlayNextData } from "@applicaster/zapp-react-native-ui-components/Components/PlayerContainer/PlayerContainer";
16
22
  import { PlayerDetails } from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/PlayerDetails";
17
23
  import { isTV } from "@applicaster/zapp-react-native-utils/reactUtils";
18
- import { useEffect, useState } from "react";
19
- import { MagicBG } from "./MagicBG";
20
24
  import { formatSpeed } from "./utils";
21
- import { addQueryParam, getLiveUrl } from "../Utils";
25
+ import {
26
+ getBottomSheetModalDefaultItemIcon,
27
+ getBottomSheetModalIconProps,
28
+ getBottomSheetModalItemProps,
29
+ getBottomSheetModalLabelProps,
30
+ getBottomSheetModalSelectedItemIcon,
31
+ } from "../Utils";
22
32
  import { useTitleSummaryOverlay } from "@applicaster/zapp-react-native-utils/appUtils/playerManager/usePlayerTitleSummaryOverlay";
23
33
  import {
34
+ AnimatedScrollModal,
24
35
  AnimationComponent,
25
36
  ComponentAnimationType,
26
- AnimatedScrollModal,
27
37
  } from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation";
28
38
  import { PADDING_HORIZONTAL } from "./Layout/const";
29
39
  import { toNumberWithDefault } from "@applicaster/zapp-react-native-utils/numberUtils";
30
40
  import {
31
- speed_0_8,
32
- speed_1,
33
- speed_1_2,
34
- speed_1_5,
35
- speed_2,
36
- } from "@applicaster/quick-brick-mobile-transport-controls";
37
- import {
41
+ SLEEP_TIMER_OFF,
38
42
  SleepTimerController,
39
43
  SleepTimerState,
40
- SLEEP_TIMER_OFF,
41
44
  } from "./SleepTimerManager";
42
- import { SpeedController, PlaybackSpeed, DEFAULT_SPEED } from "./SpeedManager";
43
- import { imageSrcFromMediaItem } from "@applicaster/zapp-react-native-utils/configurationUtils";
44
- import { useTheme } from "@applicaster/zapp-react-native-utils/theme";
45
+ import { DEFAULT_SPEED, PlaybackSpeed, SpeedController } from "./SpeedManager";
46
+ import {
47
+ openBottomSheetModal,
48
+ dismissModal as dismissBottomSheetModal,
49
+ useModalStoreState,
50
+ } from "@applicaster/zapp-react-native-utils/modalState";
51
+ import { getSleepTimerOptions } from "../Const/sleepTimerOptions";
52
+ import { speedOptions } from "../Const/speedOptions";
45
53
 
46
54
  const { log_debug } = createLogger({
47
55
  subsystem: "UIComponent",
@@ -57,8 +65,6 @@ type Dimensions = {
57
65
 
58
66
  type Configuration = {
59
67
  [key: string]: any;
60
- magic_background?: boolean;
61
- audio_player_background_image_query?: string;
62
68
  audio_player_background_image_default_color?: string;
63
69
  tablet_landscape_sidebar_width?: string;
64
70
  tablet_landscape_player_container_background_color?: string;
@@ -67,7 +73,6 @@ type Configuration = {
67
73
  type Props = {
68
74
  children: React.ReactNode;
69
75
  inline?: boolean;
70
- docked?: boolean;
71
76
  configuration: Configuration;
72
77
  style: ViewStyle & Dimensions;
73
78
  entry: ZappEntry;
@@ -83,61 +88,27 @@ type Props = {
83
88
 
84
89
  const { width: SCREEN_WIDTH } = ScreenDimensions.get("screen");
85
90
 
86
- const Styles = {
87
- mainContainer: (style: ViewStyle) => {
88
- const combinedStyle: ViewStyle = {
89
- flex: 1,
90
- };
91
-
92
- return {
93
- ...combinedStyle,
94
- ...style,
95
- };
96
- },
91
+ const Styles = StyleSheet.create({
97
92
  playerContainer: {
98
93
  flex: 1,
99
94
  },
100
95
  paddingHorizontal: { paddingTop: 0, paddingHorizontal: PADDING_HORIZONTAL },
101
-
102
- controlsMobile: {
103
- height: 50,
104
- marginHorizontal: 24,
105
- },
106
- controlsTablet: {
107
- height: 96,
108
- marginHorizontal: 24,
109
- },
110
96
  playerDetails: {
111
97
  marginTop: 60,
112
98
  alignSelf: "center",
113
99
  width: SCREEN_WIDTH - PADDING_HORIZONTAL * 2,
114
100
  },
115
-
116
- linearGradient: {
117
- flex: 1,
118
- },
119
- };
120
-
121
- const sleeps = [
122
- // { label: "End of episode", value: "episode" },
123
- { label: "5 minutes", value: 5 },
124
- { label: "10 minutes", value: 10 },
125
- { label: "15 minutes", value: 15 },
126
- { label: "30 minutes", value: 30 },
127
- { label: "45 minutes", value: 45 },
128
- { label: "1 hour", value: 60 },
129
- { label: "2 hours", value: 120 },
130
- ];
101
+ });
131
102
 
132
103
  const edges: Edge[] = ["right", "left", "top"];
133
104
 
134
105
  export const AudioPlayerWrapper: React.FC<Props> = (props: Props) => {
135
106
  const player = usePlayer();
136
107
  const playerState = usePlayerState("audio-player-wrapper");
137
- const theme = useTheme();
108
+
109
+ const modalBottomSheetState = useModalStoreState();
138
110
 
139
111
  const {
140
- docked,
141
112
  configuration,
142
113
  style,
143
114
  entry,
@@ -147,24 +118,11 @@ export const AudioPlayerWrapper: React.FC<Props> = (props: Props) => {
147
118
  isTabletPortrait,
148
119
  } = props;
149
120
 
150
- const speeds = [
151
- { asset: configuration["speed_0_8"] || speed_0_8, value: 0.8 },
152
- { asset: configuration["speed_1"] || speed_1, value: 1.0 },
153
- { asset: configuration["speed_1_2"] || speed_1_2, value: 1.2 },
154
- { asset: configuration["speed_1_5"] || speed_1_5, value: 1.5 },
155
- { asset: configuration["speed_2"] || speed_2, value: 2.0 },
156
- ];
157
-
158
121
  const isTablet = useIsTablet();
159
122
 
160
123
  const isTabletLandscape = !isTV() && isTablet && !isTabletPortrait;
161
124
 
162
- // TODO: Have generic place for live url from configuration. Currently its hardcoded for client.
163
-
164
- const feedUrl = getLiveUrl(entry?.extensions?.live?.channel_src ?? "");
165
-
166
125
  const { title, summary } = useTitleSummaryOverlay(
167
- feedUrl,
168
126
  entry,
169
127
  playerState?.isLive,
170
128
  configuration?.audio_live_player_update_interval
@@ -187,6 +145,24 @@ export const AudioPlayerWrapper: React.FC<Props> = (props: Props) => {
187
145
  }
188
146
  }, [player]);
189
147
 
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]);
165
+
190
166
  const [playbackSpeed, setPlaybackSpeed] =
191
167
  useState<PlaybackSpeed>(DEFAULT_SPEED);
192
168
 
@@ -202,8 +178,6 @@ export const AudioPlayerWrapper: React.FC<Props> = (props: Props) => {
202
178
  height: 0,
203
179
  });
204
180
 
205
- const navigator = useNavigation();
206
-
207
181
  const { maximiseVideoModal } = useNavigation();
208
182
 
209
183
  const onLayout = (event: any) => {
@@ -293,44 +267,51 @@ export const AudioPlayerWrapper: React.FC<Props> = (props: Props) => {
293
267
  );
294
268
 
295
269
  const onSpeedButtonPress = React.useCallback(() => {
296
- navigator.openModalBottomSheet({
270
+ openBottomSheetModal({
297
271
  modalBottomSheetContentProps: {
298
- items: speeds,
272
+ items: speedOptions,
299
273
  current_selection: playbackSpeed,
300
274
  onPress: onSpeedSelect,
301
275
  title: configuration["playback_speed_title"],
276
+ itemProps: getBottomSheetModalItemProps,
277
+ iconProps: getBottomSheetModalIconProps,
278
+ labelProps: getBottomSheetModalLabelProps,
279
+ getSelectedItemIcon: getBottomSheetModalSelectedItemIcon,
280
+ getDefaultItemIcon: getBottomSheetModalDefaultItemIcon,
281
+ iconPlacement: "right",
302
282
  },
303
283
  options: {
304
- supportedOrientations: ["portrait"],
284
+ supportedOrientations: [
285
+ "portrait",
286
+ "landscape",
287
+ "portrait-upside-down",
288
+ ],
305
289
  },
306
290
  });
307
- }, [
308
- playbackSpeed,
309
- setPlaybackSpeed,
310
- navigator,
311
- onSpeedSelect,
312
- configuration["playback_speed_title"],
313
- ]);
291
+ }, [playbackSpeed, onSpeedSelect, configuration["playback_speed_title"]]);
314
292
 
315
293
  const onSleepButtonPress = React.useCallback(() => {
316
- navigator.openModalBottomSheet({
294
+ openBottomSheetModal({
317
295
  modalBottomSheetContentProps: {
318
- items: [
319
- {
320
- label: configuration["playback_sleep_off_label"],
321
- value: 0,
322
- },
323
- ].concat(sleeps),
296
+ items: getSleepTimerOptions(configuration),
324
297
  current_selection: sleepTimerState.timer,
325
298
  onPress: onSleepSelect,
326
299
  title: configuration["playback_sleep_title"],
300
+ itemProps: getBottomSheetModalItemProps,
301
+ iconProps: getBottomSheetModalIconProps,
302
+ labelProps: getBottomSheetModalLabelProps,
303
+ getSelectedItemIcon: getBottomSheetModalSelectedItemIcon,
304
+ iconPlacement: "right",
327
305
  },
328
306
  options: {
329
- supportedOrientations: ["portrait"],
307
+ supportedOrientations: [
308
+ "portrait",
309
+ "landscape",
310
+ "portrait-upside-down",
311
+ ],
330
312
  },
331
313
  });
332
314
  }, [
333
- navigator,
334
315
  sleepTimerState.timer,
335
316
  configuration["playback_sleep_title"],
336
317
  configuration["playback_sleep_off_label"],
@@ -364,114 +345,61 @@ export const AudioPlayerWrapper: React.FC<Props> = (props: Props) => {
364
345
  player?.seekTo(0);
365
346
  }, [player]);
366
347
 
367
- const MainContent = React.useMemo(() => {
368
- return (
369
- <SafeAreaView style={Styles.mainContainer(style)} edges={edges}>
370
- <AnimationComponent
371
- animationType={ComponentAnimationType.moveUpComponent}
372
- additionalData={{ saveArea: true }}
373
- style={Styles.playerContainer}
374
- >
375
- <AnimatedScrollModal>
376
- <View style={Styles.playerContainer} onLayout={onLayout}>
377
- <Layout
378
- entry={entry}
379
- playerState={playerState}
380
- layoutState={layoutState}
381
- value={value}
382
- onPlaybackButtonPress={onPlaybackButtonPress}
383
- onRewindButtonPress={onRewindButtonPress}
384
- onForwardButtonPress={onForwardButtonPress}
385
- onPlayerSeek={onPlayerSeek}
386
- onSkipStart={onSkipStart}
387
- onSpeedButtonPress={onSpeedButtonPress}
388
- onSleepButtonPress={onSleepButtonPress}
389
- playbackSpeedName={formatSpeed(playbackSpeed.value)}
390
- playbackSleepName={
391
- sleepTimerState.timer.value === 0
392
- ? "sleep_timer"
393
- : "sleep_timer_active"
394
- }
395
- sleepTimerDate={sleepTimerState.timerDate}
396
- cancelSleepTimer={cancelSleepTimer}
397
- onSkipLive={onSkipLive}
398
- onCloseVideoModal={onCloseVideoModal}
399
- maximiseVideoModal={maximiseVideoModal}
400
- configuration={configuration}
401
- dimensions={dimensions}
402
- playNextData={playNextData}
403
- title={title}
404
- summary={summary}
405
- defaultDimensions={defaultDimensions}
406
- />
407
- <View style={Styles.paddingHorizontal}>
408
- {children}
409
- <AnimationComponent
410
- animationType={ComponentAnimationType.componentFade}
411
- >
412
- <PlayerDetails
413
- configuration={configuration}
414
- style={Styles.playerDetails}
415
- entry={entry}
416
- isTabletLandscape={isTabletLandscape}
417
- isAudioPlayer={true}
418
- />
419
- </AnimationComponent>
420
- </View>
421
- </View>
422
- </AnimatedScrollModal>
423
- </AnimationComponent>
424
- </SafeAreaView>
425
- );
426
- }, [
427
- docked,
428
- style,
429
- entry,
430
- playerState,
431
- layoutState,
432
- value,
433
- onPlaybackButtonPress,
434
- onRewindButtonPress,
435
- onForwardButtonPress,
436
- onPlayerSeek,
437
- onCloseVideoModal,
438
- maximiseVideoModal,
439
- configuration,
440
- dimensions,
441
- children,
442
- playNextData,
443
- onSkipStart,
444
- onSkipLive,
445
- sleepTimerState.timer.value,
446
- sleepTimerState.timerDate,
447
- ]);
448
-
449
- if (configuration.magic_background) {
450
- const baseUrl = imageSrcFromMediaItem(entry, null);
451
-
452
- const queryParamName =
453
- configuration.audio_player_background_image_query || "width";
454
-
455
- const defaultBackgroundColor =
456
- configuration.audio_player_background_image_default_color ||
457
- theme?.app_background_color;
458
-
459
- const queryParamValue = 15;
460
-
461
- const url =
462
- baseUrl && addQueryParam(baseUrl, queryParamName, queryParamValue);
463
-
464
- return (
465
- <MagicBG
466
- image={url}
467
- fallbackUrl={baseUrl}
468
- colors={entry?.extensions?.backgroundColors}
469
- defaultColor={defaultBackgroundColor}
348
+ return (
349
+ <SafeAreaView style={[style, Styles.playerContainer]} edges={edges}>
350
+ <AnimationComponent
351
+ animationType={ComponentAnimationType.moveUpComponent}
352
+ additionalData={{ saveArea: true }}
353
+ style={Styles.playerContainer}
470
354
  >
471
- {MainContent}
472
- </MagicBG>
473
- );
474
- }
475
-
476
- return MainContent;
355
+ <AnimatedScrollModal>
356
+ <View style={Styles.playerContainer} onLayout={onLayout}>
357
+ <Layout
358
+ entry={entry}
359
+ playerState={playerState}
360
+ layoutState={layoutState}
361
+ value={value}
362
+ onPlaybackButtonPress={onPlaybackButtonPress}
363
+ onRewindButtonPress={onRewindButtonPress}
364
+ onForwardButtonPress={onForwardButtonPress}
365
+ onPlayerSeek={onPlayerSeek}
366
+ onSkipStart={onSkipStart}
367
+ onSpeedButtonPress={onSpeedButtonPress}
368
+ onSleepButtonPress={onSleepButtonPress}
369
+ playbackSpeedName={formatSpeed(playbackSpeed.value)}
370
+ playbackSleepName={
371
+ sleepTimerState.timer.value === 0
372
+ ? "sleep_timer"
373
+ : "sleep_timer_active"
374
+ }
375
+ sleepTimerDate={sleepTimerState.timerDate}
376
+ cancelSleepTimer={cancelSleepTimer}
377
+ onSkipLive={onSkipLive}
378
+ onCloseVideoModal={onCloseVideoModal}
379
+ maximiseVideoModal={maximiseVideoModal}
380
+ configuration={configuration}
381
+ dimensions={dimensions}
382
+ playNextData={playNextData}
383
+ title={title}
384
+ summary={summary}
385
+ />
386
+ <View style={Styles.paddingHorizontal}>
387
+ {children}
388
+ <AnimationComponent
389
+ animationType={ComponentAnimationType.componentFade}
390
+ >
391
+ <PlayerDetails
392
+ isAudioPlayer
393
+ configuration={configuration}
394
+ style={Styles.playerDetails}
395
+ entry={entry}
396
+ isTabletLandscape={isTabletLandscape}
397
+ />
398
+ </AnimationComponent>
399
+ </View>
400
+ </View>
401
+ </AnimatedScrollModal>
402
+ </AnimationComponent>
403
+ </SafeAreaView>
404
+ );
477
405
  };