@applicaster/quick-brick-player 13.0.0-alpha.5131435627 → 13.0.0-alpha.5145183145

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 (25) hide show
  1. package/package.json +5 -6
  2. package/src/Player/AudioLayer/AudioDescription.tsx +109 -68
  3. package/src/Player/AudioLayer/AudioPlayerWrapper.tsx +88 -126
  4. package/src/Player/AudioLayer/Layout/Controls/VerticalGutter.tsx +23 -5
  5. package/src/Player/AudioLayer/Layout/Controls/index.tsx +4 -0
  6. package/src/Player/AudioLayer/Layout/DockedControls/index.tsx +21 -19
  7. package/src/Player/AudioLayer/Layout/MobileLayout.tsx +4 -5
  8. package/src/Player/AudioLayer/Layout/PlayerImage/AnimatedImage.tsx +9 -9
  9. package/src/Player/AudioLayer/Layout/PlayerImage/FlexImage.tsx +4 -9
  10. package/src/Player/AudioLayer/Layout/PlayerImage/index.tsx +25 -21
  11. package/src/Player/AudioLayer/Layout/PlayerImage/styles.ts +6 -0
  12. package/src/Player/AudioLayer/Layout/TabletLandscapeLayout.tsx +105 -101
  13. package/src/Player/AudioLayer/Layout/TabletPortraitLayout.tsx +2 -3
  14. package/src/Player/AudioLayer/Layout/TransportInfo/index.tsx +19 -5
  15. package/src/Player/AudioLayer/Layout/const.ts +4 -0
  16. package/src/Player/AudioLayer/Layout/hooks/useTransportInfoHeight.ts +1 -1
  17. package/src/Player/AudioLayer/Layout/utils.ts +7 -0
  18. package/src/Player/hooks/useIsCasting.tsx +57 -0
  19. package/src/Player/index.tsx +10 -5
  20. package/src/QuickBrickPlayer.tsx +3 -0
  21. package/src/Player/AudioLayer/LinearGradient/LinearGradientProxy.ts +0 -3
  22. package/src/Player/AudioLayer/LinearGradient/LinearGradientProxy.web.ts +0 -3
  23. package/src/Player/AudioLayer/LinearGradient/index.ts +0 -1
  24. package/src/Player/AudioLayer/MagicBG/index.tsx +0 -155
  25. 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.5131435627",
3
+ "version": "13.0.0-alpha.5145183145",
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-alpha.5131435627",
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.5131435627",
41
- "@applicaster/zapp-react-native-ui-components": "13.0.0-alpha.5131435627",
42
- "@applicaster/zapp-react-native-utils": "13.0.0-alpha.5131435627",
40
+ "@applicaster/zapp-react-native-tvos-app": "13.0.0-alpha.5145183145",
41
+ "@applicaster/zapp-react-native-ui-components": "13.0.0-alpha.5145183145",
42
+ "@applicaster/zapp-react-native-utils": "13.0.0-alpha.5145183145",
43
43
  "query-string": "7.1.3",
44
44
  "react-native-web-linear-gradient": "1.1.2",
45
45
  "shaka-player": "4.3.5",
@@ -52,7 +52,6 @@
52
52
  "@applicaster/applicaster-types": "*",
53
53
  "@applicaster/blur": "*",
54
54
  "@applicaster/quick-brick-xray": "*",
55
- "@applicaster/react-native-color-thief": "*",
56
55
  "@applicaster/zapp-pipes-v2-client": "*",
57
56
  "@applicaster/zapp-react-dom-ui-components": "*",
58
57
  "@applicaster/zapp-react-native-redux": "*",
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { Text, TextStyle } 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,84 +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 titleStyles = (value: GetValue, prefix: string): TextStyle => ({
17
- textAlign: "left",
18
- color: value(`${prefix}title_color`),
19
- alignSelf: "center",
20
- paddingBottom: 5,
21
- lineHeight:
22
- Number(
23
- platformSelect({
24
- ios: value(`${prefix}title_lineheight_ios`),
25
- android: value(`${prefix}title_lineheight_android`),
26
- })
27
- ) || 18,
28
- letterSpacing:
29
- Number(
30
- platformSelect({
31
- ios: value(`${prefix}title_letterspacing_ios`),
32
- android: value(`${prefix}title_letterspacing_android`),
33
- })
34
- ) || 0,
35
- fontSize:
36
- Number(
37
- platformSelect({
38
- ios: value(`${prefix}title_fontsize_ios`),
39
- android: value(`${prefix}title_fontsize_android`),
40
- })
41
- ) || 16,
42
- fontFamily: platformSelect({
43
- ios: value(`${prefix}title_font_ios`),
44
- android: value(`${prefix}title_font_android`),
45
- }),
46
- });
17
+ const TITLE_PADDING_BOTTOM = 5;
18
+ const TITLE_LINES = 2;
19
+ const SUBTITLE_LINES = 1;
47
20
 
48
- const summaryStyles = (value: GetValue, prefix: string): TextStyle => ({
49
- textAlign: "left",
50
- color: value(`${prefix}subtitle_color`),
51
- alignSelf: "center",
52
- lineHeight:
53
- Number(
54
- platformSelect({
55
- ios: value(`${prefix}subtitle_lineheight_ios`),
56
- android: value(`${prefix}subtitle_lineheight_android`),
57
- })
58
- ) || 18,
59
- letterSpacing:
60
- Number(
61
- platformSelect({
62
- ios: value(`${prefix}subtitle_letterspacing_ios`),
63
- android: value(`${prefix}subtitle_letterspacing_android`),
64
- })
65
- ) || 0,
66
- fontSize:
67
- Number(
68
- platformSelect({
69
- ios: value(`${prefix}subtitle_fontsize_ios`),
70
- android: value(`${prefix}subtitle_fontsize_android`),
71
- })
72
- ) || 13,
73
- fontFamily: platformSelect({
74
- ios: value(`${prefix}subtitle_font_ios`),
75
- android: value(`${prefix}subtitle_font_android`),
76
- }),
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
+ },
77
37
  });
78
38
 
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;
101
+
79
102
  export const AudioDescription = (props: AudioDescriptionProps) => {
80
- const { title, summary, layoutState, value } = props;
103
+ const { title, summary, layoutState, value, maxWidth } = props;
81
104
  const prefix = layoutState.docked ? "docked_player_" : "";
82
105
 
106
+ const summaryStyles = getSummaryStyles(value, prefix);
107
+ const titleStyles = getTitleStyles(value, prefix);
108
+
109
+ const height = getHeight(titleStyles.lineHeight, summaryStyles.lineHeight);
110
+
83
111
  return (
84
- <>
85
- <Text style={titleStyles(value, prefix)} numberOfLines={2}>
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}>
86
122
  {title}
87
123
  </Text>
88
- <Text style={summaryStyles(value, prefix)} numberOfLines={1}>
89
- {summary}
90
- </Text>
91
- </>
124
+ {summary ? (
125
+ <Text
126
+ style={[styles.summaryText, summaryStyles]}
127
+ numberOfLines={SUBTITLE_LINES}
128
+ >
129
+ {summary}
130
+ </Text>
131
+ ) : null}
132
+ </View>
92
133
  );
93
134
  };
@@ -1,12 +1,13 @@
1
1
  import * as React from "react";
2
+ import { useEffect, useState } from "react";
2
3
  import {
4
+ Dimensions as ScreenDimensions,
3
5
  StyleSheet,
4
- ViewStyle,
5
6
  View,
6
- Dimensions as ScreenDimensions,
7
+ ViewStyle,
7
8
  } from "react-native";
8
9
 
9
- import { SafeAreaView, Edge } from "react-native-safe-area-context";
10
+ import { Edge, SafeAreaView } from "react-native-safe-area-context";
10
11
  import { usePlayerState } from "@applicaster/zapp-react-native-utils/appUtils/playerManager/usePlayerState";
11
12
  import { usePlayer } from "@applicaster/zapp-react-native-utils/appUtils/playerManager/usePlayer";
12
13
  import * as R from "ramda";
@@ -20,11 +21,8 @@ import { createLogger } from "@applicaster/zapp-react-native-utils/logger";
20
21
  import { PlayNextData } from "@applicaster/zapp-react-native-ui-components/Components/PlayerContainer/PlayerContainer";
21
22
  import { PlayerDetails } from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/PlayerDetails";
22
23
  import { isTV } from "@applicaster/zapp-react-native-utils/reactUtils";
23
- import { useEffect, useState } from "react";
24
- import { MagicBG } from "./MagicBG";
25
24
  import { formatSpeed } from "./utils";
26
25
  import {
27
- addQueryParam,
28
26
  getBottomSheetModalDefaultItemIcon,
29
27
  getBottomSheetModalIconProps,
30
28
  getBottomSheetModalItemProps,
@@ -33,21 +31,23 @@ import {
33
31
  } from "../Utils";
34
32
  import { useTitleSummaryOverlay } from "@applicaster/zapp-react-native-utils/appUtils/playerManager/usePlayerTitleSummaryOverlay";
35
33
  import {
34
+ AnimatedScrollModal,
36
35
  AnimationComponent,
37
36
  ComponentAnimationType,
38
- AnimatedScrollModal,
39
37
  } from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation";
40
38
  import { PADDING_HORIZONTAL } from "./Layout/const";
41
39
  import { toNumberWithDefault } from "@applicaster/zapp-react-native-utils/numberUtils";
42
40
  import {
41
+ SLEEP_TIMER_OFF,
43
42
  SleepTimerController,
44
43
  SleepTimerState,
45
- SLEEP_TIMER_OFF,
46
44
  } from "./SleepTimerManager";
47
- import { SpeedController, PlaybackSpeed, DEFAULT_SPEED } from "./SpeedManager";
48
- import { imageSrcFromMediaItem } from "@applicaster/zapp-react-native-utils/configurationUtils";
49
- import { useTheme } from "@applicaster/zapp-react-native-utils/theme";
50
- import { openBottomSheetModal } from "@applicaster/zapp-react-native-utils/modalState";
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
51
  import { getSleepTimerOptions } from "../Const/sleepTimerOptions";
52
52
  import { speedOptions } from "../Const/speedOptions";
53
53
 
@@ -65,8 +65,6 @@ type Dimensions = {
65
65
 
66
66
  type Configuration = {
67
67
  [key: string]: any;
68
- magic_background?: boolean;
69
- audio_player_background_image_query?: string;
70
68
  audio_player_background_image_default_color?: string;
71
69
  tablet_landscape_sidebar_width?: string;
72
70
  tablet_landscape_player_container_background_color?: string;
@@ -75,7 +73,6 @@ type Configuration = {
75
73
  type Props = {
76
74
  children: React.ReactNode;
77
75
  inline?: boolean;
78
- docked?: boolean;
79
76
  configuration: Configuration;
80
77
  style: ViewStyle & Dimensions;
81
78
  entry: ZappEntry;
@@ -108,10 +105,10 @@ const edges: Edge[] = ["right", "left", "top"];
108
105
  export const AudioPlayerWrapper: React.FC<Props> = (props: Props) => {
109
106
  const player = usePlayer();
110
107
  const playerState = usePlayerState("audio-player-wrapper");
111
- const theme = useTheme();
108
+
109
+ const modalBottomSheetState = useModalStoreState();
112
110
 
113
111
  const {
114
- docked,
115
112
  configuration,
116
113
  style,
117
114
  entry,
@@ -148,6 +145,24 @@ export const AudioPlayerWrapper: React.FC<Props> = (props: Props) => {
148
145
  }
149
146
  }, [player]);
150
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
+
151
166
  const [playbackSpeed, setPlaybackSpeed] =
152
167
  useState<PlaybackSpeed>(DEFAULT_SPEED);
153
168
 
@@ -330,114 +345,61 @@ export const AudioPlayerWrapper: React.FC<Props> = (props: Props) => {
330
345
  player?.seekTo(0);
331
346
  }, [player]);
332
347
 
333
- const MainContent = React.useMemo(() => {
334
- return (
335
- <SafeAreaView style={[style, Styles.playerContainer]} edges={edges}>
336
- <AnimationComponent
337
- animationType={ComponentAnimationType.moveUpComponent}
338
- additionalData={{ saveArea: true }}
339
- style={Styles.playerContainer}
340
- >
341
- <AnimatedScrollModal>
342
- <View style={Styles.playerContainer} onLayout={onLayout}>
343
- <Layout
344
- entry={entry}
345
- playerState={playerState}
346
- layoutState={layoutState}
347
- value={value}
348
- onPlaybackButtonPress={onPlaybackButtonPress}
349
- onRewindButtonPress={onRewindButtonPress}
350
- onForwardButtonPress={onForwardButtonPress}
351
- onPlayerSeek={onPlayerSeek}
352
- onSkipStart={onSkipStart}
353
- onSpeedButtonPress={onSpeedButtonPress}
354
- onSleepButtonPress={onSleepButtonPress}
355
- playbackSpeedName={formatSpeed(playbackSpeed.value)}
356
- playbackSleepName={
357
- sleepTimerState.timer.value === 0
358
- ? "sleep_timer"
359
- : "sleep_timer_active"
360
- }
361
- sleepTimerDate={sleepTimerState.timerDate}
362
- cancelSleepTimer={cancelSleepTimer}
363
- onSkipLive={onSkipLive}
364
- onCloseVideoModal={onCloseVideoModal}
365
- maximiseVideoModal={maximiseVideoModal}
366
- configuration={configuration}
367
- dimensions={dimensions}
368
- playNextData={playNextData}
369
- title={title}
370
- summary={summary}
371
- defaultDimensions={defaultDimensions}
372
- />
373
- <View style={Styles.paddingHorizontal}>
374
- {children}
375
- <AnimationComponent
376
- animationType={ComponentAnimationType.componentFade}
377
- >
378
- <PlayerDetails
379
- isAudioPlayer
380
- configuration={configuration}
381
- style={Styles.playerDetails}
382
- entry={entry}
383
- isTabletLandscape={isTabletLandscape}
384
- />
385
- </AnimationComponent>
386
- </View>
387
- </View>
388
- </AnimatedScrollModal>
389
- </AnimationComponent>
390
- </SafeAreaView>
391
- );
392
- }, [
393
- docked,
394
- style,
395
- entry,
396
- playerState,
397
- layoutState,
398
- value,
399
- onPlaybackButtonPress,
400
- onRewindButtonPress,
401
- onForwardButtonPress,
402
- onPlayerSeek,
403
- onCloseVideoModal,
404
- maximiseVideoModal,
405
- configuration,
406
- dimensions,
407
- children,
408
- playNextData,
409
- onSkipStart,
410
- onSkipLive,
411
- sleepTimerState.timer.value,
412
- sleepTimerState.timerDate,
413
- ]);
414
-
415
- if (configuration.magic_background) {
416
- const baseUrl = imageSrcFromMediaItem(entry, null);
417
-
418
- const queryParamName =
419
- configuration.audio_player_background_image_query || "width";
420
-
421
- const defaultBackgroundColor =
422
- configuration.audio_player_background_image_default_color ||
423
- theme?.app_background_color;
424
-
425
- const queryParamValue = 15;
426
-
427
- const url =
428
- baseUrl && addQueryParam(baseUrl, queryParamName, queryParamValue);
429
-
430
- return (
431
- <MagicBG
432
- image={url}
433
- fallbackUrl={baseUrl}
434
- colors={entry?.extensions?.backgroundColors}
435
- 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}
436
354
  >
437
- {MainContent}
438
- </MagicBG>
439
- );
440
- }
441
-
442
- 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
+ );
443
405
  };
@@ -3,25 +3,43 @@ import { View, StyleSheet } from "react-native";
3
3
 
4
4
  import { useIsTablet } from "@applicaster/zapp-react-native-utils/reactHooks";
5
5
 
6
- import { TABLET_VERTICAL_SEPARATOR_HEIGHT } from "../const";
6
+ import {
7
+ TABLET_VERTICAL_SEPARATOR_HEIGHT,
8
+ TABLET_VERTICAL_SEPARATOR_HEIGHT_S,
9
+ } from "../const";
7
10
 
8
11
  import { withDebug } from "../debug";
12
+ import { useSafeAreaFrame } from "react-native-safe-area-context";
13
+ import { isSmallTabletHeight } from "../utils";
9
14
 
10
15
  const styles = StyleSheet.create({
11
16
  flexingHeight: {
12
17
  flex: 1,
13
-
14
18
  ...withDebug({ backgroundColor: "red" }),
15
19
  },
16
20
  fixedHeight: {
17
21
  height: TABLET_VERTICAL_SEPARATOR_HEIGHT,
18
-
22
+ ...withDebug({ backgroundColor: "red" }),
23
+ },
24
+ fixedHeightSmall: {
25
+ height: TABLET_VERTICAL_SEPARATOR_HEIGHT_S,
19
26
  ...withDebug({ backgroundColor: "red" }),
20
27
  },
21
28
  });
22
29
 
23
30
  export const VerticalGutter = () => {
24
31
  const isTablet = useIsTablet();
25
-
26
- return <View style={isTablet ? styles.fixedHeight : styles.flexingHeight} />;
32
+ const { height } = useSafeAreaFrame();
33
+
34
+ return (
35
+ <View
36
+ style={
37
+ isTablet
38
+ ? isSmallTabletHeight(height)
39
+ ? styles.fixedHeightSmall
40
+ : styles.fixedHeight
41
+ : styles.flexingHeight
42
+ }
43
+ />
44
+ );
27
45
  };
@@ -79,6 +79,8 @@ type Props = {
79
79
  onSpeedButtonPress: Callback;
80
80
  onSleepButtonPress: Callback;
81
81
 
82
+ maxWidth?: number;
83
+
82
84
  docked: boolean;
83
85
  };
84
86
 
@@ -104,6 +106,7 @@ export const Controls = (props: Props) => {
104
106
  onSkipLive,
105
107
  onSpeedButtonPress,
106
108
  onSleepButtonPress,
109
+ maxWidth = 320,
107
110
 
108
111
  docked,
109
112
  } = props;
@@ -270,6 +273,7 @@ export const Controls = (props: Props) => {
270
273
  summary={summary}
271
274
  value={value}
272
275
  layoutState={layoutState}
276
+ maxWidth={maxWidth}
273
277
  />
274
278
 
275
279
  <VerticalGutter />
@@ -30,13 +30,13 @@ type Props = {
30
30
  layoutState: QuickBrickPlayer.LayoutState;
31
31
  playerState: QuickBrickPlayer.PlayerState;
32
32
  value: GetValue;
33
- configuration: QuickBrickPlayer.AudioPlayerProps["configuration"];
34
33
  dimensions: QuickBrickPlayer.AudioPlayerProps["dimensions"];
35
34
  onCloseVideoModal: () => void;
36
35
  onPlayerSeek: (targetTime: number) => void;
37
36
  playNextData: PlayNextData;
38
37
  title: string | number;
39
38
  summary: string | number;
39
+ ImageComponent?: React.ReactNode;
40
40
  };
41
41
 
42
42
  const styles = StyleSheet.create({
@@ -53,6 +53,7 @@ const styles = StyleSheet.create({
53
53
  touchableArea: {
54
54
  flexShrink: 1,
55
55
  flex: 1,
56
+ flexDirection: "row",
56
57
  alignSelf: "stretch",
57
58
  },
58
59
  contentInfo: {
@@ -95,7 +96,7 @@ const playerDimensionsStyle = (
95
96
  minimisedHeight: number,
96
97
  addPadding: boolean
97
98
  ): ViewStyle => ({
98
- paddingLeft: addPadding ? toNumberWithDefault(100, minimisedHeight) : 0,
99
+ width: addPadding ? toNumberWithDefault(100, minimisedHeight) : 0,
99
100
  });
100
101
 
101
102
  const animatedContainerStyle = (
@@ -181,13 +182,13 @@ export const DockedControls = (props: Props) => {
181
182
  layoutState,
182
183
  playerState,
183
184
  value,
184
- configuration,
185
185
  dimensions,
186
186
  onCloseVideoModal,
187
187
  onPlayerSeek,
188
188
  playNextData,
189
189
  title,
190
190
  summary,
191
+ ImageComponent,
191
192
  } = props;
192
193
 
193
194
  const isTablet = useIsTablet();
@@ -245,21 +246,22 @@ export const DockedControls = (props: Props) => {
245
246
  )}
246
247
  />
247
248
  <TouchableWithoutFeedback onPress={maximazeVideoModal}>
248
- <View
249
- style={[
250
- styles.touchableArea,
251
- playerDimensionsStyle(
252
- minimisedHeight,
253
- isActiveGesture || layoutState.docked
254
- ),
255
- ]}
256
- >
257
- <View
258
- style={[
259
- styles.contentInfo,
260
- !configuration.magic_background && backgroundColorStyle(value),
261
- ]}
262
- >
249
+ <View style={styles.touchableArea}>
250
+ {isActiveGesture || layoutState.docked ? (
251
+ <View
252
+ style={{ width: toNumberWithDefault(100, minimisedHeight) }}
253
+ >
254
+ {ImageComponent || null}
255
+ </View>
256
+ ) : (
257
+ <View
258
+ style={playerDimensionsStyle(
259
+ minimisedHeight,
260
+ isActiveGesture || layoutState.docked
261
+ )}
262
+ />
263
+ )}
264
+ <View style={[styles.contentInfo, backgroundColorStyle(value)]}>
263
265
  <ContentInfo
264
266
  content={{ ...entry, title, summary }}
265
267
  value={value}
@@ -273,7 +275,7 @@ export const DockedControls = (props: Props) => {
273
275
  isTablet
274
276
  ? styles.controlsContainerForTablet
275
277
  : styles.controlsContainerForMobile,
276
- !configuration.magic_background && backgroundColorStyle(value),
278
+ backgroundColorStyle(value),
277
279
  ]}
278
280
  >
279
281
  <Controls