@applicaster/quick-brick-player 13.0.0-rc.11 → 13.0.0-rc.111

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 (43) hide show
  1. package/package.json +27 -14
  2. package/src/CellPlayer/Assets/AssetsComponent.tsx +17 -3
  3. package/src/Player/AudioLayer/AudioDescription.tsx +5 -7
  4. package/src/Player/AudioLayer/AudioPlayerWrapper.tsx +174 -280
  5. package/src/Player/AudioLayer/Layout/Controls/VerticalGutter.tsx +27 -0
  6. package/src/Player/AudioLayer/Layout/Controls/index.tsx +316 -0
  7. package/src/Player/AudioLayer/Layout/{defaultLayoutsConts.ts → Controls/utils.ts} +7 -25
  8. package/src/Player/AudioLayer/Layout/Debug/index.tsx +55 -0
  9. package/src/Player/AudioLayer/Layout/{DockedLayout.tsx → DockedControls/index.tsx} +44 -74
  10. package/src/Player/AudioLayer/Layout/MobileLayout.tsx +230 -0
  11. package/src/Player/AudioLayer/Layout/PlayerImage/AnimatedImage.tsx +83 -0
  12. package/src/Player/AudioLayer/Layout/PlayerImage/FlexImage.tsx +25 -0
  13. package/src/Player/AudioLayer/Layout/PlayerImage/index.tsx +101 -0
  14. package/src/Player/AudioLayer/Layout/PlayerImage/styles.ts +26 -0
  15. package/src/Player/AudioLayer/Layout/TabletLandscapeLayout.tsx +215 -0
  16. package/src/Player/AudioLayer/Layout/TabletPortraitLayout.tsx +223 -0
  17. package/src/Player/AudioLayer/Layout/TransportInfo/index.tsx +115 -0
  18. package/src/Player/AudioLayer/Layout/VerticalGutter/index.tsx +8 -0
  19. package/src/Player/AudioLayer/Layout/const.ts +22 -0
  20. package/src/Player/AudioLayer/Layout/debug.ts +6 -0
  21. package/src/Player/AudioLayer/Layout/hooks/index.ts +5 -0
  22. package/src/Player/AudioLayer/Layout/hooks/useMobileLayoutImageSize.ts +14 -0
  23. package/src/Player/AudioLayer/Layout/hooks/useTabletLayoutImageSize.ts +105 -0
  24. package/src/Player/AudioLayer/Layout/hooks/useTransportInfoHeight.ts +54 -0
  25. package/src/Player/AudioLayer/Layout/index.tsx +21 -48
  26. package/src/Player/AudioLayer/Layout/types.ts +7 -0
  27. package/src/Player/AudioLayer/SleepTimerManager.ts +119 -0
  28. package/src/Player/AudioLayer/SpeedManager.ts +52 -0
  29. package/src/Player/AudioLayer/utils.ts +27 -0
  30. package/src/Player/Const/sleepTimerOptions.ts +39 -0
  31. package/src/Player/Const/speedOptions.ts +4 -0
  32. package/src/Player/Utils/Utils.ts +0 -5
  33. package/src/Player/Utils/index.tsx +117 -0
  34. package/src/Player/hooks/useIsCasting.tsx +57 -0
  35. package/src/Player/index.tsx +39 -22
  36. package/src/QuickBrickPlayer.tsx +3 -0
  37. package/src/Player/AudioLayer/Layout/DefaultLayout.tsx +0 -452
  38. package/src/Player/AudioLayer/LinearGradient/LinearGradientProxy.ts +0 -3
  39. package/src/Player/AudioLayer/LinearGradient/LinearGradientProxy.web.ts +0 -3
  40. package/src/Player/AudioLayer/LinearGradient/index.ts +0 -1
  41. package/src/Player/AudioLayer/MagicBG/index.tsx +0 -155
  42. package/src/Player/Helpers/VideoResizeMode.ts +0 -7
  43. package/src/utils/utils.ts +0 -25
@@ -0,0 +1,223 @@
1
+ import * as React from "react";
2
+ import { StyleSheet, View, ViewStyle } from "react-native";
3
+ import {
4
+ useSafeAreaFrame,
5
+ useSafeAreaInsets,
6
+ } from "react-native-safe-area-context";
7
+ import { useModalAnimationContext } from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation";
8
+ import { toNumberWithDefaultZero } from "@applicaster/zapp-react-native-utils/numberUtils";
9
+
10
+ import { withDebug } from "./debug";
11
+ import { TABLET_PORTRAIT } from "./const";
12
+
13
+ import { TransportInfo } from "./TransportInfo";
14
+ import { PlayerImage } from "./PlayerImage";
15
+ import { Controls } from "./Controls";
16
+
17
+ import { useTabletLayoutImageSize } from "./hooks";
18
+ import { DockedControls } from "./DockedControls";
19
+ import { VerticalGutter } from "./VerticalGutter";
20
+
21
+ import { Props } from "./types";
22
+
23
+ const styles = StyleSheet.create({
24
+ container: {
25
+ flex: 1,
26
+
27
+ ...withDebug({
28
+ borderWidth: 2,
29
+ borderColor: "magenta",
30
+ }),
31
+ },
32
+
33
+ flex: {
34
+ flex: 1,
35
+ },
36
+
37
+ fillContainer: {
38
+ ...StyleSheet.absoluteFillObject,
39
+ alignItems: "center",
40
+ ...withDebug({
41
+ borderWidth: 2,
42
+ borderColor: "red",
43
+ }),
44
+ },
45
+
46
+ audioPlayerContainer: {
47
+ flex: 1,
48
+ maxWidth: TABLET_PORTRAIT.MAX_WIDTH,
49
+ marginLeft: TABLET_PORTRAIT.MARGIN_HORIZONTAL,
50
+ marginRight: TABLET_PORTRAIT.MARGIN_HORIZONTAL,
51
+
52
+ ...withDebug({
53
+ borderWidth: 2,
54
+ borderColor: "blue",
55
+ }),
56
+ },
57
+ });
58
+
59
+ const tabletStyles = ({
60
+ screenHeight,
61
+ topInset,
62
+ bottomInset,
63
+ topOffset,
64
+ }): ViewStyle => ({
65
+ alignItems: "center",
66
+ height: screenHeight - topInset - bottomInset,
67
+ opacity: topOffset ? 1 : 0, // hide content until topOffset is calculated
68
+ });
69
+
70
+ const justifyContent = (topOffset: Option<number>) =>
71
+ topOffset ? "flex-start" : "center";
72
+
73
+ export function TabletPortraitLayout({
74
+ entry,
75
+ layoutState,
76
+ playerState,
77
+ value,
78
+ onPlaybackButtonPress,
79
+ onRewindButtonPress,
80
+ onForwardButtonPress,
81
+ onPlayerSeek,
82
+ onSkipStart,
83
+ onSkipLive,
84
+ onSpeedButtonPress,
85
+ onSleepButtonPress,
86
+ onCloseVideoModal,
87
+ playbackSpeedName,
88
+ playbackSleepName,
89
+ configuration,
90
+ dimensions,
91
+ playNextData,
92
+ cancelSleepTimer,
93
+ sleepTimerDate,
94
+ title,
95
+ summary,
96
+ }: Props) {
97
+ const { docked } = layoutState;
98
+
99
+ const { bottom: bottomInset, top: topInset } = useSafeAreaInsets();
100
+ const { height: screenHeight } = useSafeAreaFrame();
101
+ const { progressBarHeight } = useModalAnimationContext();
102
+
103
+ const {
104
+ imageSize,
105
+ offsetY: topOffset,
106
+ onLayout,
107
+ } = useTabletLayoutImageSize({ isPortraitMode: true });
108
+
109
+ return (
110
+ <View
111
+ style={[
112
+ styles.container,
113
+ tabletStyles({
114
+ screenHeight,
115
+ topInset,
116
+ bottomInset,
117
+ topOffset,
118
+ }),
119
+ ]}
120
+ >
121
+ {/* TransportInfo */}
122
+ <TransportInfo
123
+ entry={entry}
124
+ layoutState={layoutState}
125
+ value={value}
126
+ configuration={configuration}
127
+ />
128
+
129
+ {/* TransportInfo */}
130
+
131
+ {/* PlayerImage */}
132
+ <View style={styles.fillContainer} pointerEvents="box-none">
133
+ <View
134
+ style={[
135
+ styles.audioPlayerContainer,
136
+ {
137
+ justifyContent: justifyContent(topOffset),
138
+ width: imageSize,
139
+ },
140
+ ]}
141
+ >
142
+ {topOffset ? <VerticalGutter height={topOffset} /> : null}
143
+
144
+ <View
145
+ style={[
146
+ styles.flex,
147
+ {
148
+ maxHeight: imageSize,
149
+
150
+ ...withDebug({
151
+ borderWidth: 2,
152
+ borderColor: "yellow",
153
+ }),
154
+ },
155
+ ]}
156
+ onLayout={onLayout}
157
+ >
158
+ <PlayerImage
159
+ entry={entry}
160
+ layoutState={layoutState}
161
+ playerState={playerState}
162
+ value={value}
163
+ configuration={configuration}
164
+ onPlayerSeek={onPlayerSeek}
165
+ onCloseVideoModal={onCloseVideoModal}
166
+ dimensions={dimensions}
167
+ playNextData={playNextData}
168
+ title={title}
169
+ summary={summary}
170
+ docked={docked}
171
+ imageWidth={imageSize}
172
+ verticalOffset={
173
+ toNumberWithDefaultZero(topOffset) - progressBarHeight
174
+ }
175
+ />
176
+ </View>
177
+
178
+ <View
179
+ style={{
180
+ maxWidth: imageSize,
181
+ }}
182
+ >
183
+ <Controls
184
+ entry={entry}
185
+ layoutState={layoutState}
186
+ playerState={playerState}
187
+ value={value}
188
+ title={title}
189
+ summary={summary}
190
+ sleepTimerDate={sleepTimerDate}
191
+ cancelSleepTimer={cancelSleepTimer}
192
+ playbackSpeedName={playbackSpeedName}
193
+ playbackSleepName={playbackSleepName}
194
+ onPlaybackButtonPress={onPlaybackButtonPress}
195
+ onRewindButtonPress={onRewindButtonPress}
196
+ onForwardButtonPress={onForwardButtonPress}
197
+ onPlayerSeek={onPlayerSeek}
198
+ onSkipStart={onSkipStart}
199
+ onSkipLive={onSkipLive}
200
+ onSpeedButtonPress={onSpeedButtonPress}
201
+ onSleepButtonPress={onSleepButtonPress}
202
+ docked={docked}
203
+ />
204
+ </View>
205
+ </View>
206
+ </View>
207
+ {/* PlayerImage */}
208
+
209
+ <DockedControls
210
+ entry={entry}
211
+ layoutState={layoutState}
212
+ playerState={playerState}
213
+ value={value}
214
+ dimensions={dimensions}
215
+ onCloseVideoModal={onCloseVideoModal}
216
+ onPlayerSeek={onPlayerSeek}
217
+ playNextData={playNextData}
218
+ title={title}
219
+ summary={summary}
220
+ />
221
+ </View>
222
+ );
223
+ }
@@ -0,0 +1,115 @@
1
+ import * as React from "react";
2
+ import { compose, map, propOr, split, take, trim } from "ramda";
3
+ import { LayoutChangeEvent, StyleSheet, View } from "react-native";
4
+
5
+ import { TransportInfo as MobileTransportInfo } from "@applicaster/quick-brick-mobile-transport-controls";
6
+ import { useIsTablet } from "@applicaster/zapp-react-native-utils/reactHooks";
7
+ import { useLanguageData } from "@applicaster/zapp-react-native-utils/reactHooks/player";
8
+ import {
9
+ AnimationComponent,
10
+ ComponentAnimationType,
11
+ } from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation";
12
+ import { toPositiveNumberWithDefaultZero } from "@applicaster/zapp-react-native-utils/numberUtils";
13
+ import { noop } from "@applicaster/zapp-react-native-utils/functionUtils";
14
+
15
+ import { NAVBAR_HEIGHT, TABLET_LANDSCAPE } from "../const";
16
+ import { withDebug } from "../debug";
17
+
18
+ const styles = StyleSheet.create({
19
+ container: {
20
+ height: NAVBAR_HEIGHT,
21
+ justifyContent: "center",
22
+ marginHorizontal: 10,
23
+ },
24
+ animatedContainer: {
25
+ width: "100%",
26
+ alignItems: "center",
27
+ justifyContent: "space-between",
28
+
29
+ ...withDebug({
30
+ borderWidth: 2,
31
+ borderColor: "yellow",
32
+ }),
33
+ },
34
+ });
35
+
36
+ const applyMarginBottom = ({ isTablet, marginBottom }) =>
37
+ isTablet ? marginBottom : 0;
38
+
39
+ type Props = {
40
+ entry: ZappEntry;
41
+ layoutState: QuickBrickPlayer.LayoutState;
42
+ value: GetValue;
43
+ configuration: QuickBrickPlayer.AudioPlayerProps["configuration"];
44
+ onLayout?: (event: LayoutChangeEvent) => void;
45
+ };
46
+
47
+ export const TransportInfo = ({
48
+ entry,
49
+ layoutState,
50
+ value,
51
+ configuration,
52
+ onLayout = noop,
53
+ }: Props) => {
54
+ const isTablet = useIsTablet();
55
+ const languageData = useLanguageData("audio-player");
56
+
57
+ const [marginBottom, setMarginBottom] = React.useState(0);
58
+
59
+ const handleLayout = React.useCallback(
60
+ (event: LayoutChangeEvent) => {
61
+ const height = toPositiveNumberWithDefaultZero(
62
+ event?.nativeEvent?.layout?.height
63
+ );
64
+
65
+ const minHeight = Math.min(height, TABLET_LANDSCAPE.MARGIN_VERTICAL);
66
+ setMarginBottom(TABLET_LANDSCAPE.MARGIN_VERTICAL - minHeight);
67
+
68
+ // pass layoutChangeEvent to upper level
69
+ onLayout(event);
70
+ },
71
+ [onLayout]
72
+ );
73
+
74
+ const actionButtons = React.useMemo(
75
+ () =>
76
+ compose(
77
+ take(2),
78
+ map(trim),
79
+ split(","),
80
+ propOr("", "player_action_buttons")
81
+ )(configuration),
82
+ [configuration.player_action_buttons]
83
+ );
84
+
85
+ return (
86
+ <View
87
+ style={[
88
+ styles.container,
89
+ {
90
+ marginBottom: applyMarginBottom({ isTablet, marginBottom }),
91
+
92
+ ...withDebug({
93
+ borderWidth: 2,
94
+ borderColor: "red",
95
+ }),
96
+ },
97
+ ]}
98
+ onLayout={handleLayout}
99
+ >
100
+ <AnimationComponent
101
+ animationType={ComponentAnimationType.componentFade}
102
+ style={styles.animatedContainer}
103
+ >
104
+ <MobileTransportInfo
105
+ content={entry}
106
+ value={value}
107
+ visible
108
+ languageData={languageData}
109
+ layoutState={layoutState}
110
+ actionButtons={actionButtons}
111
+ />
112
+ </AnimationComponent>
113
+ </View>
114
+ );
115
+ };
@@ -0,0 +1,8 @@
1
+ import * as React from "react";
2
+ import { View } from "react-native";
3
+
4
+ import { withDebug } from "../debug";
5
+
6
+ export const VerticalGutter = ({ height }: { height: number }) => (
7
+ <View style={{ height, ...withDebug({ backgroundColor: "red" }) }} />
8
+ );
@@ -0,0 +1,22 @@
1
+ export const PADDING_HORIZONTAL = 15;
2
+
3
+ export const TABLET_VERTICAL_SEPARATOR_HEIGHT = 32;
4
+
5
+ export const TABLET_LANDSCAPE = {
6
+ MARGIN_VERTICAL: 80, // gap between safe-area edge and audio-player container
7
+ MAX_HEIGHT: 750,
8
+ };
9
+
10
+ export const TABLET_PORTRAIT = {
11
+ MARGIN_HORIZONTAL: 180,
12
+ MAX_WIDTH: 550,
13
+ };
14
+
15
+ export const MOBILE = {
16
+ MARGIN_HORIZONTAL: 30,
17
+ MARGIN_BOTTOM: 48,
18
+ MARGIN_TOP: 10,
19
+ MIN_HEIGHT: 458,
20
+ };
21
+
22
+ export const NAVBAR_HEIGHT = 60;
@@ -0,0 +1,6 @@
1
+ // use this variable to activate borders on AudioPlayer. It will help you to fix layout if needed.
2
+ export const DEBUG = false;
3
+
4
+ export const withDebug = (style) => {
5
+ return DEBUG ? style : {};
6
+ };
@@ -0,0 +1,5 @@
1
+ export { useTabletLayoutImageSize } from "./useTabletLayoutImageSize";
2
+
3
+ export { useMobileLayoutImageSize } from "./useMobileLayoutImageSize";
4
+
5
+ export { useTransportInfoHeight } from "./useTransportInfoHeight";
@@ -0,0 +1,14 @@
1
+ import { useDimensions } from "@applicaster/zapp-react-native-utils/reactHooks/layout";
2
+ import { MOBILE } from "../const";
3
+
4
+ type Return = {
5
+ imageSize: Option<number>;
6
+ };
7
+
8
+ export const useMobileLayoutImageSize = (): Return => {
9
+ const { width } = useDimensions("screen");
10
+
11
+ return {
12
+ imageSize: width - 2 * MOBILE.MARGIN_HORIZONTAL,
13
+ };
14
+ };
@@ -0,0 +1,105 @@
1
+ import * as React from "react";
2
+ import { LayoutChangeEvent } from "react-native";
3
+
4
+ import { toNumber } from "@applicaster/zapp-react-native-utils/numberUtils";
5
+ import { Subject } from "rxjs";
6
+ import { first, debounceTime, filter } from "rxjs/operators";
7
+ import { useRefWithInitialValue } from "@applicaster/zapp-react-native-utils/reactHooks/state/useRefWithInitialValue";
8
+
9
+ const TIMEOUT = 200; // ms
10
+
11
+ type Layout = {
12
+ x: number;
13
+ y: number;
14
+ width: number;
15
+ height: number;
16
+ };
17
+
18
+ const builder = () => {
19
+ const layoutChange$ = new Subject<Layout>();
20
+
21
+ const emitLayoutChange = (layout: Layout): void => {
22
+ layoutChange$.next(layout);
23
+ };
24
+
25
+ return {
26
+ emitLayoutChange,
27
+ layoutChange$,
28
+ };
29
+ };
30
+
31
+ type Props = {
32
+ isPortraitMode: boolean;
33
+ };
34
+
35
+ type Return = {
36
+ imageSize: Option<number>;
37
+ offsetY: Option<number>;
38
+ onLayout: (event: LayoutChangeEvent) => void;
39
+ };
40
+
41
+ export const useTabletLayoutImageSize = ({ isPortraitMode }: Props): Return => {
42
+ const [imageSize, setImageSize] = React.useState(undefined);
43
+ const [offsetY, setOffsetY] = React.useState(undefined);
44
+
45
+ const layoutRef = useRefWithInitialValue<ReturnType<typeof builder>>(builder);
46
+
47
+ React.useEffect(() => {
48
+ const subscription = layoutRef.current.layoutChange$
49
+ // for landscape layout we need to wait the second layout change in order to get proper size of image
50
+ .pipe(debounceTime(TIMEOUT), first())
51
+ .subscribe({
52
+ next: (layout: Layout) => {
53
+ const size = isPortraitMode
54
+ ? Math.min(layout.height, layout.width)
55
+ : layout.height;
56
+
57
+ setImageSize(size);
58
+ },
59
+ });
60
+
61
+ return () => {
62
+ subscription.unsubscribe();
63
+ };
64
+ }, [isPortraitMode]);
65
+
66
+ React.useEffect(() => {
67
+ const subscription = layoutRef.current.layoutChange$
68
+ .pipe(
69
+ filter((layout: Layout) => layout.y > 0),
70
+ debounceTime(TIMEOUT),
71
+ first()
72
+ )
73
+ .subscribe({
74
+ next: (layout: Layout) => {
75
+ setOffsetY(layout.y);
76
+ },
77
+ });
78
+
79
+ return () => {
80
+ subscription.unsubscribe();
81
+ };
82
+ }, []);
83
+
84
+ const handleLayout = React.useCallback((event: LayoutChangeEvent) => {
85
+ const height = toNumber(event?.nativeEvent?.layout?.height);
86
+ const width = toNumber(event?.nativeEvent?.layout?.width);
87
+ const y = toNumber(event?.nativeEvent?.layout?.y);
88
+ const x = toNumber(event?.nativeEvent?.layout?.x);
89
+
90
+ const layout: Layout = {
91
+ x,
92
+ y,
93
+ width,
94
+ height,
95
+ };
96
+
97
+ layoutRef.current.emitLayoutChange(layout);
98
+ }, []);
99
+
100
+ return {
101
+ imageSize,
102
+ offsetY,
103
+ onLayout: handleLayout,
104
+ };
105
+ };
@@ -0,0 +1,54 @@
1
+ import * as React from "react";
2
+ import { LayoutChangeEvent } from "react-native";
3
+ import { toNumber } from "@applicaster/zapp-react-native-utils/numberUtils";
4
+ import { Subject } from "rxjs";
5
+ import { first } from "rxjs/operators";
6
+ import { useRefWithInitialValue } from "@applicaster/zapp-react-native-utils/reactHooks/state/useRefWithInitialValue";
7
+
8
+ const builder = () => {
9
+ const layoutChange$ = new Subject<number>();
10
+
11
+ const emitLayoutChange = (height: number): void => {
12
+ layoutChange$.next(height);
13
+ };
14
+
15
+ return {
16
+ emitLayoutChange,
17
+ layoutChange$,
18
+ };
19
+ };
20
+
21
+ export const useTransportInfoHeight = () => {
22
+ const [height, setHeight] = React.useState(undefined);
23
+
24
+ const layoutRef = useRefWithInitialValue<ReturnType<typeof builder>>(builder);
25
+
26
+ React.useEffect(() => {
27
+ const subscription = layoutRef.current.layoutChange$
28
+ // skip first layout and take the second with proper size
29
+ // then ignore any layout update
30
+ .pipe(first())
31
+ .subscribe({
32
+ next: (size: number) => {
33
+ setHeight(size);
34
+ },
35
+ });
36
+
37
+ return () => {
38
+ subscription.unsubscribe();
39
+ };
40
+ }, []);
41
+
42
+ const handleLayout = React.useCallback((event: LayoutChangeEvent) => {
43
+ const height = toNumber(event?.nativeEvent?.layout?.height);
44
+
45
+ if (height) {
46
+ layoutRef.current.emitLayoutChange(height);
47
+ }
48
+ }, []);
49
+
50
+ return {
51
+ height,
52
+ onLayout: handleLayout,
53
+ };
54
+ };
@@ -1,52 +1,25 @@
1
- import React from "react";
2
- import DefaultLayout from "./DefaultLayout";
3
- import { PlayNextData } from "@applicaster/zapp-react-native-ui-components/Components/PlayerContainer/PlayerContainer";
1
+ import * as React from "react";
4
2
 
5
- type Dimensions = {
6
- width: number;
7
- height: number;
8
- };
3
+ import { useIsTablet } from "@applicaster/zapp-react-native-utils/reactHooks";
4
+ import { useIsTabletLandscape } from "@applicaster/zapp-react-native-utils/reactHooks/device/useMemoizedIsTablet";
9
5
 
10
- type LayoutProps = {
11
- entry: ZappEntry;
12
- layoutState: {
13
- inline: boolean;
14
- docked: boolean;
15
- isModal: boolean;
16
- };
17
- playerState: {
18
- currentTime: number;
19
- duration: number;
20
- seekableDuration: number;
21
- isLive: boolean;
22
- isPaused: boolean;
23
- isBuffering: boolean;
24
- };
25
- value: GetValue;
26
- sleepTimerDate: number;
27
- playbackSpeedName: string;
28
- playbackSleepName: string;
29
- configuration: { [key: string]: any };
30
- onPlaybackButtonPress: () => void;
31
- onRewindButtonPress: () => void;
32
- onForwardButtonPress: () => void;
33
- onSpeedButtonPress: () => void;
34
- onSleepButtonPress: () => void;
35
- onCloseVideoModal: () => void;
36
- cancelSleepTimer: () => void;
37
- onPlayerSeek: (targetTime: number) => void;
38
- onSkipStart: () => void;
39
- onSkipLive: () => void;
40
- maximiseVideoModal: () => void;
41
- dimensions: Dimensions;
42
- defaultDimensions: Dimensions;
43
- playNextData: PlayNextData;
44
- title: string | number;
45
- summary: string | number;
46
- };
6
+ import { TabletPortraitLayout } from "./TabletPortraitLayout";
7
+ import { TabletLandscapeLayout } from "./TabletLandscapeLayout";
8
+ import { MobileLayout } from "./MobileLayout";
47
9
 
48
- export default function Layout(
49
- props: LayoutProps
50
- ): React.ReactElement<LayoutProps> {
51
- return <DefaultLayout {...props} />;
10
+ import { Props } from "./types";
11
+
12
+ export default function Layout(props: Props) {
13
+ const isTablet = useIsTablet();
14
+ const isTabletLandscape = useIsTabletLandscape();
15
+
16
+ if (!isTablet) {
17
+ return <MobileLayout {...props} />;
18
+ }
19
+
20
+ if (isTabletLandscape) {
21
+ return <TabletLandscapeLayout {...props} />;
22
+ }
23
+
24
+ return <TabletPortraitLayout {...props} />;
52
25
  }
@@ -0,0 +1,7 @@
1
+ import { PlayNextData } from "@applicaster/zapp-react-native-ui-components/Components/PlayerContainer/PlayerContainer";
2
+
3
+ export type Props = QuickBrickPlayer.AudioPlayerProps & {
4
+ playNextData: PlayNextData;
5
+ };
6
+
7
+ export { PlayNextData };