@applicaster/quick-brick-player 13.0.0-alpha.1291347678 → 13.0.0-alpha.1313712178

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