@applicaster/quick-brick-player 13.0.0-rc.98 → 13.0.0

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 (39) hide show
  1. package/package.json +6 -7
  2. package/src/Player/AudioLayer/AudioDescription.tsx +109 -68
  3. package/src/Player/AudioLayer/AudioPlayerWrapper.tsx +81 -189
  4. package/src/Player/AudioLayer/Layout/Controls/VerticalGutter.tsx +23 -5
  5. package/src/Player/AudioLayer/Layout/Controls/index.tsx +46 -60
  6. package/src/Player/AudioLayer/Layout/Controls/utils.ts +5 -13
  7. package/src/Player/AudioLayer/Layout/Debug/index.tsx +55 -0
  8. package/src/Player/AudioLayer/Layout/DockedControls/index.tsx +38 -19
  9. package/src/Player/AudioLayer/Layout/MobileLayout.tsx +35 -25
  10. package/src/Player/AudioLayer/Layout/PlayerImage/AnimatedImage.tsx +39 -40
  11. package/src/Player/AudioLayer/Layout/PlayerImage/FlexImage.tsx +6 -22
  12. package/src/Player/AudioLayer/Layout/PlayerImage/hooks/index.ts +1 -0
  13. package/src/Player/AudioLayer/Layout/PlayerImage/hooks/useChangePlayerState.ts +99 -0
  14. package/src/Player/AudioLayer/Layout/PlayerImage/index.tsx +37 -20
  15. package/src/Player/AudioLayer/Layout/PlayerImage/styles.ts +19 -0
  16. package/src/Player/AudioLayer/Layout/TabletLandscapeLayout.tsx +101 -103
  17. package/src/Player/AudioLayer/Layout/TabletPortraitLayout.tsx +5 -14
  18. package/src/Player/AudioLayer/Layout/TransportInfo/index.tsx +39 -13
  19. package/src/Player/AudioLayer/Layout/const.ts +6 -0
  20. package/src/Player/AudioLayer/Layout/debug.ts +1 -1
  21. package/src/Player/AudioLayer/Layout/hooks/index.ts +3 -1
  22. package/src/Player/AudioLayer/Layout/hooks/useMobileLayoutImageSize.ts +14 -0
  23. package/src/Player/AudioLayer/Layout/hooks/{useImageSize.ts → useTabletLayoutImageSize.ts} +10 -5
  24. package/src/Player/AudioLayer/Layout/hooks/useTransportInfoHeight.ts +1 -1
  25. package/src/Player/AudioLayer/Layout/utils.ts +7 -0
  26. package/src/Player/AudioLayer/SleepTimerManager.ts +22 -11
  27. package/src/Player/AudioLayer/components/SleepTimerModalHeader/SleepTimerModalHeader.tsx +66 -0
  28. package/src/Player/AudioLayer/components/SleepTimerModalHeader/index.ts +1 -0
  29. package/src/Player/AudioLayer/useSleepTimerModal.ts +109 -0
  30. package/src/Player/Const/sleepTimerOptions.ts +7 -5
  31. package/src/Player/Utils/index.tsx +6 -0
  32. package/src/Player/hooks/useIsCasting.tsx +57 -0
  33. package/src/Player/index.tsx +84 -37
  34. package/src/QuickBrickPlayer.tsx +3 -0
  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/utils/utils.ts +0 -25
@@ -1,32 +1,16 @@
1
1
  import * as React from "react";
2
- import { ImageBackground } from "react-native";
3
-
4
- import { imageSrcFromMediaItem } from "@applicaster/zapp-react-native-utils/configurationUtils";
2
+ import { Image, ImageStyle } from "react-native";
3
+ import { useBackgroundImage } from "@applicaster/zapp-react-native-utils/audioPlayerUtils";
5
4
 
6
5
  type Props = {
7
6
  entry: ZappEntry;
8
- style?: { [K: string]: any };
9
- imageStyle?: { [K: string]: any };
7
+ style?: ImageStyle;
10
8
  };
11
9
 
12
- const style = { flex: 1, aspectRatio: 1 };
13
-
14
- export const FlexImage = ({ entry, imageStyle }: Props) => {
15
- const source = React.useMemo(
16
- () => ({ uri: imageSrcFromMediaItem(entry, undefined) }),
17
- [entry]
18
- );
19
-
20
- if (!source) return null;
10
+ export const FlexImage = ({ entry, style }: Props) => {
11
+ const backgroundImageSource = useBackgroundImage(entry);
21
12
 
22
13
  return (
23
- <ImageBackground
24
- resizeMode="cover"
25
- style={style}
26
- source={source}
27
- imageStyle={imageStyle}
28
- >
29
- {null}
30
- </ImageBackground>
14
+ <Image resizeMode="cover" style={style} source={backgroundImageSource} />
31
15
  );
32
16
  };
@@ -0,0 +1 @@
1
+ export { useChangePlayerState } from "./useChangePlayerState";
@@ -0,0 +1,99 @@
1
+ import * as React from "react";
2
+ import { Subject, Observable } from "rxjs";
3
+
4
+ import { distinctUntilChanged } from "rxjs/operators";
5
+ import { isNil } from "@applicaster/zapp-react-native-utils/utils";
6
+ import { useRefWithInitialValue } from "@applicaster/zapp-react-native-utils/reactHooks/state/useRefWithInitialValue";
7
+ import { usePrevious } from "@applicaster/zapp-react-native-utils/reactHooks/utils";
8
+ import {
9
+ useModalAnimationContext,
10
+ PlayerAnimationStateEnum,
11
+ } from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation";
12
+ import { PlayerAnimationStateT } from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation/ModalAnimationContext";
13
+
14
+ const builder = () => {
15
+ const changePlayerState$ = new Subject<PlayerAnimationStateT>();
16
+
17
+ const emitMaximized = (): void => {
18
+ changePlayerState$.next(PlayerAnimationStateEnum.maximize);
19
+ };
20
+
21
+ const emitMinimized = (): void => {
22
+ changePlayerState$.next(PlayerAnimationStateEnum.minimize);
23
+ };
24
+
25
+ const emitAppearInDocked = (): void => {
26
+ // if audio_player was presented in docked mode
27
+ changePlayerState$.next(PlayerAnimationStateEnum.appear_as_docked);
28
+ };
29
+
30
+ return {
31
+ emitMaximized,
32
+ emitMinimized,
33
+ emitAppearInDocked,
34
+ changePlayerState$: changePlayerState$.pipe(distinctUntilChanged()),
35
+ };
36
+ };
37
+
38
+ export const useChangePlayerState = ({
39
+ docked,
40
+ }): Observable<PlayerAnimationStateT> => {
41
+ const changePlayerStateRef =
42
+ useRefWithInitialValue<ReturnType<typeof builder>>(builder);
43
+
44
+ const { playerAnimationState } = useModalAnimationContext();
45
+
46
+ const previousPlayerAnimationState = usePrevious(playerAnimationState);
47
+
48
+ React.useEffect(() => {
49
+ if (
50
+ !docked &&
51
+ isNil(previousPlayerAnimationState) &&
52
+ playerAnimationState === PlayerAnimationStateEnum.minimize
53
+ ) {
54
+ changePlayerStateRef.current.emitMinimized();
55
+
56
+ return;
57
+ }
58
+
59
+ if (
60
+ !docked &&
61
+ isNil(previousPlayerAnimationState) &&
62
+ playerAnimationState === PlayerAnimationStateEnum.maximize
63
+ ) {
64
+ changePlayerStateRef.current.emitMaximized();
65
+
66
+ return;
67
+ }
68
+
69
+ if (
70
+ !docked &&
71
+ previousPlayerAnimationState === PlayerAnimationStateEnum.drag_scroll &&
72
+ playerAnimationState === PlayerAnimationStateEnum.maximize
73
+ ) {
74
+ changePlayerStateRef.current.emitMaximized();
75
+
76
+ return;
77
+ }
78
+
79
+ if (
80
+ !docked &&
81
+ previousPlayerAnimationState === PlayerAnimationStateEnum.drag_scroll &&
82
+ playerAnimationState === PlayerAnimationStateEnum.minimize
83
+ ) {
84
+ changePlayerStateRef.current.emitMinimized();
85
+
86
+ return;
87
+ }
88
+
89
+ if (
90
+ docked &&
91
+ isNil(previousPlayerAnimationState) &&
92
+ isNil(playerAnimationState)
93
+ ) {
94
+ changePlayerStateRef.current.emitAppearInDocked();
95
+ }
96
+ }, [previousPlayerAnimationState, playerAnimationState, docked]);
97
+
98
+ return changePlayerStateRef.current.changePlayerState$;
99
+ };
@@ -1,10 +1,13 @@
1
1
  import * as React from "react";
2
+ import { LayoutChangeEvent, View } from "react-native";
2
3
 
3
4
  import {
4
5
  AnimationComponent,
5
6
  ComponentAnimationType,
6
7
  useModalAnimationContext,
7
8
  } from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation";
9
+ import { noop } from "@applicaster/zapp-react-native-utils/functionUtils";
10
+ import { toBooleanWithDefaultTrue } from "@applicaster/zapp-react-native-utils/booleanUtils";
8
11
 
9
12
  import { AnimatedImage } from "./AnimatedImage";
10
13
  import { FlexImage } from "./FlexImage";
@@ -26,8 +29,9 @@ type Props = {
26
29
  title: string | number;
27
30
  summary: string | number;
28
31
  docked: boolean;
29
- imageWidth: Option<number>;
32
+ imageWidth?: Option<number>;
30
33
  verticalOffset: number;
34
+ onLayoutImage?: (event: LayoutChangeEvent) => void;
31
35
  };
32
36
 
33
37
  export const PlayerImage = (props: Props) => {
@@ -35,9 +39,10 @@ export const PlayerImage = (props: Props) => {
35
39
  entry,
36
40
  dimensions,
37
41
  docked,
38
- imageWidth,
39
42
  verticalOffset,
43
+ imageWidth,
40
44
  configuration,
45
+ onLayoutImage = noop,
41
46
  } = props;
42
47
 
43
48
  const {
@@ -47,6 +52,12 @@ export const PlayerImage = (props: Props) => {
47
52
  minimisedHeight,
48
53
  } = useModalAnimationContext();
49
54
 
55
+ const isShadowEnabled = toBooleanWithDefaultTrue(
56
+ configuration?.audio_player_artwork_shadow_enabled
57
+ );
58
+
59
+ const shouldShowShadow = !docked && isShadowEnabled;
60
+
50
61
  const borderRadius = calculateBorderRadius(
51
62
  docked,
52
63
  startComponentsAnimation,
@@ -71,24 +82,30 @@ export const PlayerImage = (props: Props) => {
71
82
  }}
72
83
  style={styles.alignItemsCenter}
73
84
  >
74
- {!imageWidth ? (
75
- // we render image with flex until we get size of this image
76
- <FlexImage
77
- entry={entry}
78
- style={styles.backgroundImageContainer}
79
- imageStyle={{ borderRadius }}
80
- />
81
- ) : null}
82
-
83
- {imageWidth ? (
84
- // we have imageSize here and now we could animate resizing of this image
85
- <AnimatedImage
86
- entry={entry}
87
- style={styles.backgroundImageContainer}
88
- imageStyle={{ borderRadius }}
89
- imageWidth={imageWidth}
90
- />
91
- ) : null}
85
+ <View
86
+ onLayout={onLayoutImage}
87
+ style={[
88
+ shouldShowShadow ? styles.shadow : undefined,
89
+ { borderRadius },
90
+ ]}
91
+ >
92
+ {!imageWidth ? (
93
+ <View style={[styles.defaultImageWrapperView, { borderRadius }]}>
94
+ <FlexImage
95
+ entry={entry}
96
+ style={styles.backgroundImageContainer}
97
+ />
98
+ </View>
99
+ ) : (
100
+ // we have imageSize here and now we could animate resizing of this image
101
+ <AnimatedImage
102
+ entry={entry}
103
+ style={[styles.backgroundImageContainer, { borderRadius }]}
104
+ imageWidth={imageWidth}
105
+ docked={docked}
106
+ />
107
+ )}
108
+ </View>
92
109
  </AnimationComponent>
93
110
  </AnimationComponent>
94
111
  );
@@ -1,9 +1,14 @@
1
+ /* eslint-disable react-native/no-color-literals */
1
2
  import { StyleSheet } from "react-native";
3
+ import { platformSelect } from "@applicaster/zapp-react-native-utils/reactUtils";
4
+
5
+ const SHADOW_COLOR = "rgba(0, 0, 0, 1)";
2
6
 
3
7
  export const styles = StyleSheet.create({
4
8
  backgroundImageContainer: {
5
9
  flex: 1,
6
10
  aspectRatio: 1,
11
+ overflow: "hidden",
7
12
  },
8
13
 
9
14
  alignItemsCenter: {
@@ -14,4 +19,18 @@ export const styles = StyleSheet.create({
14
19
  flex: {
15
20
  flex: 1,
16
21
  },
22
+ defaultImageWrapperView: {
23
+ overflow: "hidden",
24
+ },
25
+ shadow: {
26
+ borderColor: "transparent",
27
+ shadowColor: SHADOW_COLOR,
28
+ shadowOffset: { width: 0, height: 24 },
29
+ shadowOpacity: platformSelect({
30
+ ios: 0.35,
31
+ default: 0.2,
32
+ }),
33
+ shadowRadius: 32,
34
+ elevation: 12,
35
+ },
17
36
  });
@@ -1,28 +1,36 @@
1
1
  import * as React from "react";
2
- import { View, ViewStyle, StyleSheet } from "react-native";
2
+ import { StyleSheet, View } from "react-native";
3
3
  import {
4
- useSafeAreaInsets,
5
4
  useSafeAreaFrame,
5
+ useSafeAreaInsets,
6
6
  } from "react-native-safe-area-context";
7
7
  import { useModalAnimationContext } from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation";
8
8
  import { isApplePlatform } from "@applicaster/zapp-react-native-utils/reactUtils";
9
9
 
10
- import { TABLET_LANDSCAPE } from "./const";
11
10
  import { TransportInfo } from "./TransportInfo";
12
11
  import { PlayerImage } from "./PlayerImage";
13
12
  import { Controls } from "./Controls";
14
13
 
15
- import { useImageSize, useTransportInfoHeight } from "./hooks";
16
14
  import { DockedControls } from "./DockedControls";
17
15
  import { withDebug } from "./debug";
18
16
 
19
17
  import { Props } from "./types";
18
+ import { isSmallTabletHeight as getIsSmallTabletHeight } from "./utils";
19
+ import { NAVBAR_HEIGHT, TABLET_LANDSCAPE } from "./const";
20
+ import { FlexImage } from "./PlayerImage/FlexImage";
20
21
 
21
22
  const isIOS = isApplePlatform();
22
23
 
24
+ const MIN_WIDTH = TABLET_LANDSCAPE.MIN_WIDTH; // Minimum width for the audio player container
25
+ const MAX_SPACING = TABLET_LANDSCAPE.MARGIN_VERTICAL; // Maximum spacing for the audio player container
26
+ const MIN_SPACING = TABLET_LANDSCAPE.MARGIN_VERTICAL_S; // Minimum spacing for the audio player container
27
+ const transportInfoHeight = NAVBAR_HEIGHT;
28
+
23
29
  const styles = StyleSheet.create({
24
30
  container: {
25
31
  flex: 1,
32
+ alignItems: "center",
33
+ height: "100%",
26
34
  ...withDebug({
27
35
  borderWidth: 2,
28
36
  borderColor: "magenta",
@@ -32,30 +40,34 @@ const styles = StyleSheet.create({
32
40
  flex: 1,
33
41
  },
34
42
  audioPlayerContainer: {
35
- flex: 1,
36
- maxHeight: TABLET_LANDSCAPE.MAX_HEIGHT,
37
43
  flexDirection: "column",
38
44
  alignItems: "center",
45
+ justifyContent: "center",
46
+ minWidth: MIN_WIDTH,
39
47
 
40
48
  ...withDebug({
41
49
  borderWidth: 2,
42
50
  borderColor: "blue",
43
51
  }),
44
52
  },
45
- });
46
-
47
- const tabletStyles = ({
48
- screenHeight,
49
- topInset,
50
- bottomInset,
51
- imageSize,
52
- }): ViewStyle => ({
53
- alignItems: "center",
54
-
55
- height: screenHeight - topInset - bottomInset,
56
- paddingBottom: TABLET_LANDSCAPE.MARGIN_VERTICAL,
57
-
58
- opacity: imageSize ? 1 : 0, // hide content until imageSize is calculated
53
+ audioPlayerContainerHeightLimit: {
54
+ maxHeight: 750,
55
+ },
56
+ audioPlayerContainerPaddings: {
57
+ paddingBottom: MAX_SPACING,
58
+ paddingTop: MAX_SPACING,
59
+ },
60
+ // For small screens, we reduce the padding to fit better
61
+ audioPlayerContainerPaddingsSmall: {
62
+ paddingBottom: MIN_SPACING,
63
+ paddingTop: MIN_SPACING,
64
+ },
65
+ controlsContainer: { flexGrow: 0, alignSelf: "stretch" },
66
+ // eslint-disable-next-line react-native/no-color-literals
67
+ debugYellow: {
68
+ borderWidth: 2,
69
+ borderColor: "yellow",
70
+ },
59
71
  });
60
72
 
61
73
  const isTabletWithHomeButton = (bottomInset: number): boolean =>
@@ -86,122 +98,108 @@ export function TabletLandscapeLayout({
86
98
  onSkipStart,
87
99
  onSkipLive,
88
100
  onSpeedButtonPress,
89
- onSleepButtonPress,
90
101
  onCloseVideoModal,
91
102
  playbackSpeedName,
92
- playbackSleepName,
93
103
  configuration,
94
104
  dimensions,
95
105
  playNextData,
96
- cancelSleepTimer,
97
- sleepTimerDate,
98
106
  title,
99
107
  summary,
100
108
  }: Props) {
109
+ const [imageWidth, setImageWidth] = React.useState(0);
101
110
  const { docked } = layoutState;
102
111
 
103
- const { bottom: bottomInset, top: topInset } = useSafeAreaInsets();
112
+ const { bottom: bottomInset } = useSafeAreaInsets();
104
113
  const { height: screenHeight } = useSafeAreaFrame();
114
+ const isSmallScreen = getIsSmallTabletHeight(screenHeight);
105
115
  const { progressBarHeight } = useModalAnimationContext();
106
116
 
107
- const { imageSize, onLayout } = useImageSize({ isPortraitMode: false });
108
-
109
- const { height: transportInfoHeight, onLayout: onTransportInfoLayout } =
110
- useTransportInfoHeight();
117
+ const onLayoutImage = React.useCallback((e) => {
118
+ setImageWidth(e.nativeEvent.layout.width);
119
+ }, []);
111
120
 
112
121
  return (
113
- <View
114
- style={[
115
- styles.container,
116
- tabletStyles({
117
- screenHeight,
118
- topInset,
119
- bottomInset,
120
- imageSize,
121
- }),
122
- ]}
123
- >
122
+ <View style={styles.container}>
124
123
  {/* TransportInfo */}
125
124
  <TransportInfo
126
125
  entry={entry}
127
126
  layoutState={layoutState}
128
127
  value={value}
129
128
  configuration={configuration}
130
- onLayout={onTransportInfoLayout}
131
129
  />
132
130
 
133
131
  {/* TransportInfo */}
134
132
 
135
- <View style={styles.audioPlayerContainer}>
136
- {/* PlayerImage */}
137
- <View
138
- style={[
139
- styles.flex,
140
- withDebug({
141
- borderWidth: 2,
142
- borderColor: "yellow",
143
- }),
144
- ]}
145
- onLayout={onLayout}
146
- >
147
- <PlayerImage
148
- entry={entry}
149
- layoutState={layoutState}
150
- playerState={playerState}
151
- value={value}
152
- configuration={configuration}
153
- onPlayerSeek={onPlayerSeek}
154
- onCloseVideoModal={onCloseVideoModal}
155
- dimensions={dimensions}
156
- playNextData={playNextData}
157
- title={title}
158
- summary={summary}
159
- docked={docked}
160
- imageWidth={imageSize}
161
- verticalOffset={
162
- transportInfoHeight +
163
- topInset +
164
- withAdditionalOffset({ progressBarHeight, bottomInset })
165
- }
166
- />
167
- </View>
168
- {/* PlayerImage */}
169
-
170
- <View
171
- style={{
172
- maxWidth: imageSize,
173
- }}
174
- >
175
- <Controls
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
- />
133
+ <View
134
+ style={[
135
+ styles.audioPlayerContainer,
136
+ {
137
+ marginTop: isSmallScreen
138
+ ? -TABLET_LANDSCAPE.MARGIN_VERTICAL_S
139
+ : -TABLET_LANDSCAPE.MARGIN_VERTICAL,
140
+ height: screenHeight - transportInfoHeight,
141
+ },
142
+ isSmallScreen
143
+ ? styles.audioPlayerContainerPaddingsSmall
144
+ : styles.audioPlayerContainerPaddings,
145
+ ]}
146
+ >
147
+ <View style={[styles.flex, styles.audioPlayerContainerHeightLimit]}>
148
+ {/* PlayerImage non-docked */}
149
+ <View style={[styles.flex, withDebug(styles.debugYellow)]}>
150
+ {!docked ? (
151
+ <PlayerImage
152
+ docked={false}
153
+ entry={entry}
154
+ layoutState={layoutState}
155
+ playerState={playerState}
156
+ value={value}
157
+ configuration={configuration}
158
+ onPlayerSeek={onPlayerSeek}
159
+ onCloseVideoModal={onCloseVideoModal}
160
+ dimensions={dimensions}
161
+ playNextData={playNextData}
162
+ title={title}
163
+ summary={summary}
164
+ verticalOffset={withAdditionalOffset({
165
+ progressBarHeight,
166
+ bottomInset,
167
+ })}
168
+ onLayoutImage={onLayoutImage}
169
+ />
170
+ ) : null}
171
+ </View>
172
+ {/* PlayerImage */}
173
+
174
+ <View style={styles.controlsContainer}>
175
+ <Controls
176
+ maxWidth={imageWidth}
177
+ entry={entry}
178
+ layoutState={layoutState}
179
+ playerState={playerState}
180
+ value={value}
181
+ title={title}
182
+ summary={summary}
183
+ playbackSpeedName={playbackSpeedName}
184
+ onPlaybackButtonPress={onPlaybackButtonPress}
185
+ onRewindButtonPress={onRewindButtonPress}
186
+ onForwardButtonPress={onForwardButtonPress}
187
+ onPlayerSeek={onPlayerSeek}
188
+ onSkipStart={onSkipStart}
189
+ onSkipLive={onSkipLive}
190
+ onSpeedButtonPress={onSpeedButtonPress}
191
+ docked={docked}
192
+ />
193
+ </View>
196
194
  </View>
197
195
  </View>
198
196
 
199
197
  <DockedControls
198
+ ImageComponent={<FlexImage entry={entry} style={styles.flex} />}
200
199
  entry={entry}
201
200
  layoutState={layoutState}
202
201
  playerState={playerState}
203
202
  value={value}
204
- configuration={configuration}
205
203
  dimensions={dimensions}
206
204
  onCloseVideoModal={onCloseVideoModal}
207
205
  onPlayerSeek={onPlayerSeek}
@@ -1,8 +1,8 @@
1
1
  import * as React from "react";
2
- import { View, ViewStyle, StyleSheet } from "react-native";
2
+ import { StyleSheet, View, ViewStyle } from "react-native";
3
3
  import {
4
- useSafeAreaInsets,
5
4
  useSafeAreaFrame,
5
+ useSafeAreaInsets,
6
6
  } from "react-native-safe-area-context";
7
7
  import { useModalAnimationContext } from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation";
8
8
  import { toNumberWithDefaultZero } from "@applicaster/zapp-react-native-utils/numberUtils";
@@ -14,7 +14,7 @@ import { TransportInfo } from "./TransportInfo";
14
14
  import { PlayerImage } from "./PlayerImage";
15
15
  import { Controls } from "./Controls";
16
16
 
17
- import { useImageSize } from "./hooks";
17
+ import { useTabletLayoutImageSize } from "./hooks";
18
18
  import { DockedControls } from "./DockedControls";
19
19
  import { VerticalGutter } from "./VerticalGutter";
20
20
 
@@ -36,7 +36,7 @@ const styles = StyleSheet.create({
36
36
 
37
37
  fillContainer: {
38
38
  ...StyleSheet.absoluteFillObject,
39
-
39
+ alignItems: "center",
40
40
  ...withDebug({
41
41
  borderWidth: 2,
42
42
  borderColor: "red",
@@ -82,15 +82,11 @@ export function TabletPortraitLayout({
82
82
  onSkipStart,
83
83
  onSkipLive,
84
84
  onSpeedButtonPress,
85
- onSleepButtonPress,
86
85
  onCloseVideoModal,
87
86
  playbackSpeedName,
88
- playbackSleepName,
89
87
  configuration,
90
88
  dimensions,
91
89
  playNextData,
92
- cancelSleepTimer,
93
- sleepTimerDate,
94
90
  title,
95
91
  summary,
96
92
  }: Props) {
@@ -104,7 +100,7 @@ export function TabletPortraitLayout({
104
100
  imageSize,
105
101
  offsetY: topOffset,
106
102
  onLayout,
107
- } = useImageSize({ isPortraitMode: true });
103
+ } = useTabletLayoutImageSize({ isPortraitMode: true });
108
104
 
109
105
  return (
110
106
  <View
@@ -187,10 +183,7 @@ export function TabletPortraitLayout({
187
183
  value={value}
188
184
  title={title}
189
185
  summary={summary}
190
- sleepTimerDate={sleepTimerDate}
191
- cancelSleepTimer={cancelSleepTimer}
192
186
  playbackSpeedName={playbackSpeedName}
193
- playbackSleepName={playbackSleepName}
194
187
  onPlaybackButtonPress={onPlaybackButtonPress}
195
188
  onRewindButtonPress={onRewindButtonPress}
196
189
  onForwardButtonPress={onForwardButtonPress}
@@ -198,7 +191,6 @@ export function TabletPortraitLayout({
198
191
  onSkipStart={onSkipStart}
199
192
  onSkipLive={onSkipLive}
200
193
  onSpeedButtonPress={onSpeedButtonPress}
201
- onSleepButtonPress={onSleepButtonPress}
202
194
  docked={docked}
203
195
  />
204
196
  </View>
@@ -211,7 +203,6 @@ export function TabletPortraitLayout({
211
203
  layoutState={layoutState}
212
204
  playerState={playerState}
213
205
  value={value}
214
- configuration={configuration}
215
206
  dimensions={dimensions}
216
207
  onCloseVideoModal={onCloseVideoModal}
217
208
  onPlayerSeek={onPlayerSeek}