@applicaster/quick-brick-player 14.0.0-alpha.1308901965 → 14.0.0-alpha.1310732876
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.
- package/package.json +6 -11
- package/src/Player/AudioLayer/AudioPlayerWrapper.tsx +25 -81
- package/src/Player/AudioLayer/Layout/Controls/index.tsx +8 -18
- package/src/Player/AudioLayer/Layout/DockedControls/index.tsx +97 -103
- package/src/Player/AudioLayer/Layout/MobileLayout.tsx +4 -37
- package/src/Player/AudioLayer/Layout/PlayerImage/index.tsx +22 -72
- package/src/Player/AudioLayer/Layout/TabletLandscapeLayout.tsx +1 -58
- package/src/Player/AudioLayer/Layout/TabletPortraitLayout.tsx +0 -33
- package/src/Player/AudioLayer/Layout/TransportInfo/index.tsx +3 -9
- package/src/Player/PlayerModal/GestureAnimatedScrollView.ts +7 -0
- package/src/Player/PlayerModal/PlayerModal.tsx +109 -0
- package/src/Player/PlayerModal/VideoPlayerModal.tsx +254 -0
- package/src/Player/PlayerModal/consts/index.ts +34 -0
- package/src/Player/PlayerModal/hooks/index.ts +188 -0
- package/src/Player/PlayerModal/index.ts +3 -0
- package/src/Player/PlayerModal/styles.ts +103 -0
- package/src/Player/index.tsx +162 -104
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applicaster/quick-brick-player",
|
|
3
|
-
"version": "14.0.0-alpha.
|
|
3
|
+
"version": "14.0.0-alpha.1310732876",
|
|
4
4
|
"description": "Quick Brick Player",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -35,13 +35,12 @@
|
|
|
35
35
|
},
|
|
36
36
|
"homepage": "https://github.com/applicaster/quickbrick#readme",
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@applicaster/quick-brick-mobile-transport-controls": "14.0.0-rc.
|
|
39
|
-
"@applicaster/quick-brick-tv-transport-controls": "14.0.0-rc.
|
|
40
|
-
"@applicaster/zapp-react-native-tvos-app": "14.0.0-alpha.
|
|
41
|
-
"@applicaster/zapp-react-native-ui-components": "14.0.0-alpha.
|
|
42
|
-
"@applicaster/zapp-react-native-utils": "14.0.0-alpha.
|
|
38
|
+
"@applicaster/quick-brick-mobile-transport-controls": "14.0.0-rc.48",
|
|
39
|
+
"@applicaster/quick-brick-tv-transport-controls": "14.0.0-rc.48",
|
|
40
|
+
"@applicaster/zapp-react-native-tvos-app": "14.0.0-alpha.1310732876",
|
|
41
|
+
"@applicaster/zapp-react-native-ui-components": "14.0.0-alpha.1310732876",
|
|
42
|
+
"@applicaster/zapp-react-native-utils": "14.0.0-alpha.1310732876",
|
|
43
43
|
"query-string": "7.1.3",
|
|
44
|
-
"react-native-web-linear-gradient": "1.1.2",
|
|
45
44
|
"shaka-player": "4.3.5",
|
|
46
45
|
"typeface-montserrat": "^0.0.54",
|
|
47
46
|
"video.js": "7.14.3",
|
|
@@ -58,15 +57,11 @@
|
|
|
58
57
|
"@applicaster/zapp-react-native-tvos-ui-components": "*",
|
|
59
58
|
"@babel/runtime": "*",
|
|
60
59
|
"@react-native-community/netinfo": "*",
|
|
61
|
-
"immer": "*",
|
|
62
60
|
"react": "*",
|
|
63
61
|
"react-native": "*",
|
|
64
62
|
"react-native-fs": "*",
|
|
65
|
-
"react-native-gesture-handler": "*",
|
|
66
63
|
"react-native-linear-gradient": "*",
|
|
67
|
-
"react-native-safe-area-context": "*",
|
|
68
64
|
"react-native-svg": "*",
|
|
69
|
-
"react-native-web": "*",
|
|
70
65
|
"react-native-webview": "*",
|
|
71
66
|
"uglify-js": "*",
|
|
72
67
|
"validate-color": "*",
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { useEffect, useState } from "react";
|
|
3
|
-
import {
|
|
4
|
-
Dimensions as ScreenDimensions,
|
|
5
|
-
StyleSheet,
|
|
6
|
-
View,
|
|
7
|
-
ViewStyle,
|
|
8
|
-
} from "react-native";
|
|
3
|
+
import { StyleSheet, View, ViewStyle } from "react-native";
|
|
9
4
|
|
|
10
5
|
import { Edge, SafeAreaView } from "react-native-safe-area-context";
|
|
11
6
|
import { usePlayerState } from "@applicaster/zapp-react-native-utils/appUtils/playerManager/usePlayerState";
|
|
@@ -13,14 +8,9 @@ import { usePlayer } from "@applicaster/zapp-react-native-utils/appUtils/playerM
|
|
|
13
8
|
import * as R from "ramda";
|
|
14
9
|
import { playerManager } from "@applicaster/zapp-react-native-utils/appUtils";
|
|
15
10
|
import Layout from "./Layout";
|
|
16
|
-
import {
|
|
17
|
-
useIsTablet,
|
|
18
|
-
useNavigation,
|
|
19
|
-
} from "@applicaster/zapp-react-native-utils/reactHooks";
|
|
11
|
+
import { useNavigation } from "@applicaster/zapp-react-native-utils/reactHooks";
|
|
20
12
|
import { createLogger } from "@applicaster/zapp-react-native-utils/logger";
|
|
21
13
|
import { PlayNextData } from "@applicaster/zapp-react-native-ui-components/Components/PlayerContainer/PlayerContainer";
|
|
22
|
-
import { PlayerDetails } from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/PlayerDetails";
|
|
23
|
-
import { isTV } from "@applicaster/zapp-react-native-utils/reactUtils";
|
|
24
14
|
import { formatSpeed } from "./utils";
|
|
25
15
|
import {
|
|
26
16
|
getBottomSheetModalDefaultItemIcon,
|
|
@@ -30,12 +20,7 @@ import {
|
|
|
30
20
|
getBottomSheetModalSelectedItemIcon,
|
|
31
21
|
} from "../Utils";
|
|
32
22
|
import { useTitleSummaryOverlay } from "@applicaster/zapp-react-native-utils/appUtils/playerManager/usePlayerTitleSummaryOverlay";
|
|
33
|
-
|
|
34
|
-
AnimatedScrollModal,
|
|
35
|
-
AnimationComponent,
|
|
36
|
-
ComponentAnimationType,
|
|
37
|
-
} from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation";
|
|
38
|
-
import { PADDING_HORIZONTAL } from "./Layout/const";
|
|
23
|
+
|
|
39
24
|
import { toNumberWithDefault } from "@applicaster/zapp-react-native-utils/numberUtils";
|
|
40
25
|
|
|
41
26
|
import { DEFAULT_SPEED, PlaybackSpeed, SpeedController } from "./SpeedManager";
|
|
@@ -81,18 +66,10 @@ type Props = {
|
|
|
81
66
|
isTabletPortrait?: boolean;
|
|
82
67
|
};
|
|
83
68
|
|
|
84
|
-
const { width: SCREEN_WIDTH } = ScreenDimensions.get("screen");
|
|
85
|
-
|
|
86
69
|
const Styles = StyleSheet.create({
|
|
87
70
|
playerContainer: {
|
|
88
71
|
flex: 1,
|
|
89
72
|
},
|
|
90
|
-
paddingHorizontal: { paddingTop: 0, paddingHorizontal: PADDING_HORIZONTAL },
|
|
91
|
-
playerDetails: {
|
|
92
|
-
marginTop: 60,
|
|
93
|
-
alignSelf: "center",
|
|
94
|
-
width: SCREEN_WIDTH - PADDING_HORIZONTAL * 2,
|
|
95
|
-
},
|
|
96
73
|
});
|
|
97
74
|
|
|
98
75
|
const edges: Edge[] = ["right", "left", "top"];
|
|
@@ -107,16 +84,10 @@ export const AudioPlayerWrapper: React.FC<Props> = (props: Props) => {
|
|
|
107
84
|
configuration,
|
|
108
85
|
style,
|
|
109
86
|
entry,
|
|
110
|
-
children,
|
|
111
87
|
layoutState,
|
|
112
88
|
playNextData = null,
|
|
113
|
-
isTabletPortrait,
|
|
114
89
|
} = props;
|
|
115
90
|
|
|
116
|
-
const isTablet = useIsTablet();
|
|
117
|
-
|
|
118
|
-
const isTabletLandscape = !isTV() && isTablet && !isTabletPortrait;
|
|
119
|
-
|
|
120
91
|
const { title, summary } = useTitleSummaryOverlay(
|
|
121
92
|
entry,
|
|
122
93
|
playerState?.isLive,
|
|
@@ -264,10 +235,6 @@ export const AudioPlayerWrapper: React.FC<Props> = (props: Props) => {
|
|
|
264
235
|
});
|
|
265
236
|
}, [playbackSpeed, onSpeedSelect, configuration["playback_speed_title"]]);
|
|
266
237
|
|
|
267
|
-
const onCloseVideoModal = React.useCallback(() => {
|
|
268
|
-
playerManager.close();
|
|
269
|
-
}, [playerManager]);
|
|
270
|
-
|
|
271
238
|
const onPlayerSeek = React.useCallback(
|
|
272
239
|
(targetTime: number) => {
|
|
273
240
|
player?.seekTo(targetTime);
|
|
@@ -285,51 +252,28 @@ export const AudioPlayerWrapper: React.FC<Props> = (props: Props) => {
|
|
|
285
252
|
|
|
286
253
|
return (
|
|
287
254
|
<SafeAreaView style={[style, Styles.playerContainer]} edges={edges}>
|
|
288
|
-
<
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
configuration={configuration}
|
|
311
|
-
dimensions={dimensions}
|
|
312
|
-
playNextData={playNextData}
|
|
313
|
-
title={title}
|
|
314
|
-
summary={summary}
|
|
315
|
-
/>
|
|
316
|
-
<View style={Styles.paddingHorizontal}>
|
|
317
|
-
{children}
|
|
318
|
-
<AnimationComponent
|
|
319
|
-
animationType={ComponentAnimationType.componentFade}
|
|
320
|
-
>
|
|
321
|
-
<PlayerDetails
|
|
322
|
-
isAudioPlayer
|
|
323
|
-
configuration={configuration}
|
|
324
|
-
style={Styles.playerDetails}
|
|
325
|
-
entry={entry}
|
|
326
|
-
isTabletLandscape={isTabletLandscape}
|
|
327
|
-
/>
|
|
328
|
-
</AnimationComponent>
|
|
329
|
-
</View>
|
|
330
|
-
</View>
|
|
331
|
-
</AnimatedScrollModal>
|
|
332
|
-
</AnimationComponent>
|
|
255
|
+
<View style={Styles.playerContainer} onLayout={onLayout}>
|
|
256
|
+
<Layout
|
|
257
|
+
entry={entry}
|
|
258
|
+
playerState={playerState}
|
|
259
|
+
layoutState={layoutState}
|
|
260
|
+
value={value}
|
|
261
|
+
onPlaybackButtonPress={onPlaybackButtonPress}
|
|
262
|
+
onRewindButtonPress={onRewindButtonPress}
|
|
263
|
+
onForwardButtonPress={onForwardButtonPress}
|
|
264
|
+
onPlayerSeek={onPlayerSeek}
|
|
265
|
+
onSkipStart={onSkipStart}
|
|
266
|
+
onSpeedButtonPress={onSpeedButtonPress}
|
|
267
|
+
playbackSpeedName={formatSpeed(playbackSpeed.value)}
|
|
268
|
+
onSkipLive={onSkipLive}
|
|
269
|
+
maximiseVideoModal={maximiseVideoModal}
|
|
270
|
+
configuration={configuration}
|
|
271
|
+
dimensions={dimensions}
|
|
272
|
+
playNextData={playNextData}
|
|
273
|
+
title={title}
|
|
274
|
+
summary={summary}
|
|
275
|
+
/>
|
|
276
|
+
</View>
|
|
333
277
|
</SafeAreaView>
|
|
334
278
|
);
|
|
335
279
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { StyleSheet } from "react-native";
|
|
2
|
+
import { StyleSheet, View } from "react-native";
|
|
3
3
|
|
|
4
4
|
import { dayjs } from "@applicaster/zapp-react-native-utils/dateUtils";
|
|
5
5
|
import {
|
|
@@ -12,11 +12,6 @@ import {
|
|
|
12
12
|
} from "@applicaster/quick-brick-mobile-transport-controls";
|
|
13
13
|
import { playerManager } from "@applicaster/zapp-react-native-utils/appUtils";
|
|
14
14
|
|
|
15
|
-
import {
|
|
16
|
-
AnimationComponent,
|
|
17
|
-
ComponentAnimationType,
|
|
18
|
-
} from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation";
|
|
19
|
-
|
|
20
15
|
import { AudioDescription } from "../../AudioDescription";
|
|
21
16
|
import { isValidDate } from "../../../Utils";
|
|
22
17
|
import { VerticalGutter } from "./VerticalGutter";
|
|
@@ -103,8 +98,6 @@ export const Controls = (props: Props) => {
|
|
|
103
98
|
onSkipLive,
|
|
104
99
|
onSpeedButtonPress,
|
|
105
100
|
maxWidth = 320,
|
|
106
|
-
|
|
107
|
-
docked,
|
|
108
101
|
} = props;
|
|
109
102
|
|
|
110
103
|
const configuration = useZStore("playerConfiguration");
|
|
@@ -229,15 +222,8 @@ export const Controls = (props: Props) => {
|
|
|
229
222
|
isLiveShowFullControls,
|
|
230
223
|
]);
|
|
231
224
|
|
|
232
|
-
if (docked) {
|
|
233
|
-
return null;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
225
|
return (
|
|
237
|
-
<
|
|
238
|
-
animationType={ComponentAnimationType.componentFade}
|
|
239
|
-
style={isTablet ? styles.nonFlex : styles.flex}
|
|
240
|
-
>
|
|
226
|
+
<View style={isTablet ? styles.nonFlex : styles.flex}>
|
|
241
227
|
<VerticalGutter />
|
|
242
228
|
|
|
243
229
|
<AudioDescription
|
|
@@ -257,7 +243,11 @@ export const Controls = (props: Props) => {
|
|
|
257
243
|
content={entry}
|
|
258
244
|
value={value}
|
|
259
245
|
visible
|
|
260
|
-
layoutState={
|
|
246
|
+
layoutState={{
|
|
247
|
+
...layoutState,
|
|
248
|
+
docked: false, // always use non-docked layout for audio (to show time labels
|
|
249
|
+
inline: true, // always use inline layout for audio (to show time labels)
|
|
250
|
+
}}
|
|
261
251
|
onPlayerSeek={onPlayerSeek}
|
|
262
252
|
playerState={playerState}
|
|
263
253
|
disableFullscreen
|
|
@@ -286,6 +276,6 @@ export const Controls = (props: Props) => {
|
|
|
286
276
|
}}
|
|
287
277
|
playerState={playerState}
|
|
288
278
|
/>
|
|
289
|
-
</
|
|
279
|
+
</View>
|
|
290
280
|
);
|
|
291
281
|
};
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import {
|
|
3
|
-
StyleSheet,
|
|
4
|
-
TouchableWithoutFeedback,
|
|
5
|
-
View,
|
|
6
|
-
ViewStyle,
|
|
7
|
-
} from "react-native";
|
|
2
|
+
import { StyleSheet, View, ViewStyle } from "react-native";
|
|
8
3
|
import * as R from "ramda";
|
|
9
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
useIsTablet,
|
|
6
|
+
useZStore,
|
|
7
|
+
} from "@applicaster/zapp-react-native-utils/reactHooks";
|
|
8
|
+
import { playerManager } from "@applicaster/zapp-react-native-utils/appUtils";
|
|
10
9
|
|
|
11
10
|
import {
|
|
12
11
|
Button,
|
|
@@ -17,15 +16,16 @@ import {
|
|
|
17
16
|
|
|
18
17
|
import { PlayNextData } from "@applicaster/zapp-react-native-ui-components/Components/PlayerContainer/PlayerContainer";
|
|
19
18
|
|
|
20
|
-
import {
|
|
21
|
-
AnimationComponent,
|
|
22
|
-
ComponentAnimationType,
|
|
23
|
-
PlayerAnimationStateEnum,
|
|
24
|
-
useModalAnimationContext,
|
|
25
|
-
} from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation";
|
|
26
19
|
import { toNumberWithDefault } from "@applicaster/zapp-react-native-utils/numberUtils";
|
|
27
20
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
21
|
+
import { useNavigation } from "@applicaster/zapp-react-native-utils/reactHooks/navigation/useNavigation";
|
|
28
22
|
import { getTabBarHeight } from "@applicaster/zapp-react-native-utils/reactHooks/navigation/getTabBarHeight";
|
|
23
|
+
import { useTitleSummaryOverlay } from "@applicaster/zapp-react-native-utils/appUtils/playerManager/usePlayerTitleSummaryOverlay";
|
|
24
|
+
import { usePlayerState } from "@applicaster/zapp-react-native-utils/appUtils/playerManager/usePlayerState";
|
|
25
|
+
import { useConfiguration } from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/utils";
|
|
26
|
+
import { noop } from "@applicaster/zapp-react-native-utils/functionUtils";
|
|
27
|
+
import { PROGRESS_BAR_HEIGHT } from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation/utils";
|
|
28
|
+
import { isMenuVisible } from "@applicaster/zapp-react-native-ui-components/Components/Screen/navigationHandler";
|
|
29
29
|
|
|
30
30
|
const bottomTabBarHeight = getTabBarHeight();
|
|
31
31
|
|
|
@@ -34,13 +34,15 @@ type Props = {
|
|
|
34
34
|
layoutState: QuickBrickPlayer.LayoutState;
|
|
35
35
|
playerState: QuickBrickPlayer.PlayerState;
|
|
36
36
|
value: GetValue;
|
|
37
|
-
dimensions: QuickBrickPlayer.AudioPlayerProps["dimensions"];
|
|
38
37
|
onCloseVideoModal: () => void;
|
|
39
38
|
onPlayerSeek: (targetTime: number) => void;
|
|
40
39
|
playNextData: PlayNextData;
|
|
41
40
|
title: string | number;
|
|
42
41
|
summary: string | number;
|
|
43
42
|
ImageComponent?: React.ReactNode;
|
|
43
|
+
isActiveGesture?: boolean;
|
|
44
|
+
minimisedHeight: number;
|
|
45
|
+
aspectRatio?: number;
|
|
44
46
|
};
|
|
45
47
|
|
|
46
48
|
const styles = StyleSheet.create({
|
|
@@ -48,6 +50,7 @@ const styles = StyleSheet.create({
|
|
|
48
50
|
flex: 1,
|
|
49
51
|
flexDirection: "column",
|
|
50
52
|
alignItems: "stretch",
|
|
53
|
+
marginTop: PROGRESS_BAR_HEIGHT,
|
|
51
54
|
},
|
|
52
55
|
content: {
|
|
53
56
|
flex: 1,
|
|
@@ -99,26 +102,6 @@ const playerDimensionsStyle = (
|
|
|
99
102
|
width: addPadding ? toNumberWithDefault(100, minimisedHeight) : 0,
|
|
100
103
|
});
|
|
101
104
|
|
|
102
|
-
const animatedContainerStyle = (
|
|
103
|
-
docked: boolean,
|
|
104
|
-
progressBarHeight: number
|
|
105
|
-
): ViewStyle => ({
|
|
106
|
-
top: progressBarHeight,
|
|
107
|
-
position: "absolute",
|
|
108
|
-
width: "100%",
|
|
109
|
-
zIndex: docked ? 1 : -1,
|
|
110
|
-
});
|
|
111
|
-
|
|
112
|
-
const backgroundImageStyle = (
|
|
113
|
-
dimensions: QuickBrickPlayer.AudioPlayerProps["dimensions"],
|
|
114
|
-
minimisedHeight: number,
|
|
115
|
-
isActiveGesture: boolean
|
|
116
|
-
): ViewStyle => ({
|
|
117
|
-
height: isActiveGesture ? minimisedHeight : dimensions.height,
|
|
118
|
-
aspectRatio: 1,
|
|
119
|
-
position: "absolute",
|
|
120
|
-
});
|
|
121
|
-
|
|
122
105
|
const controlButtons = (
|
|
123
106
|
live: boolean,
|
|
124
107
|
paused: boolean,
|
|
@@ -180,107 +163,118 @@ export const DockedControls = (props: Props) => {
|
|
|
180
163
|
const {
|
|
181
164
|
entry,
|
|
182
165
|
layoutState,
|
|
183
|
-
|
|
184
|
-
value,
|
|
185
|
-
dimensions,
|
|
186
|
-
onCloseVideoModal,
|
|
187
|
-
onPlayerSeek,
|
|
166
|
+
onPlayerSeek = noop,
|
|
188
167
|
playNextData,
|
|
189
|
-
title,
|
|
190
|
-
summary,
|
|
191
168
|
ImageComponent,
|
|
169
|
+
isActiveGesture = true,
|
|
170
|
+
aspectRatio,
|
|
192
171
|
} = props;
|
|
193
172
|
|
|
194
|
-
const
|
|
173
|
+
const onCloseVideoModal = React.useCallback(() => {
|
|
174
|
+
playerManager.close();
|
|
175
|
+
}, []);
|
|
195
176
|
|
|
196
|
-
const
|
|
177
|
+
const { currentRoute, screenData } = useNavigation();
|
|
197
178
|
|
|
198
|
-
const
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
179
|
+
const menuVisible = isMenuVisible(currentRoute, screenData);
|
|
180
|
+
|
|
181
|
+
const { minimised_height: minimisedHeight } = useConfiguration();
|
|
182
|
+
|
|
183
|
+
const configuration = useZStore("playerConfiguration")();
|
|
184
|
+
const playerState = usePlayerState("shared-player-wrapper-docked");
|
|
185
|
+
|
|
186
|
+
const getValue = (key: string, stylesObj: {}) =>
|
|
187
|
+
R.propOr(null, key, stylesObj);
|
|
188
|
+
|
|
189
|
+
const value = React.useCallback(
|
|
190
|
+
(key: string) => {
|
|
191
|
+
const retVal = getValue(key, configuration);
|
|
192
|
+
|
|
193
|
+
const minimumAllowedSeekableDurationInSeconds = getValue(
|
|
194
|
+
"minimumAllowedSeekableDurationInSeconds",
|
|
195
|
+
configuration
|
|
196
|
+
);
|
|
205
197
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
198
|
+
if (key === "liveSeekingEnabled") {
|
|
199
|
+
return playerState.seekableDuration <
|
|
200
|
+
minimumAllowedSeekableDurationInSeconds || playerManager.isCasting()
|
|
201
|
+
? false
|
|
202
|
+
: retVal;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
return retVal;
|
|
206
|
+
},
|
|
207
|
+
[...Object.values(configuration), playerState]
|
|
208
|
+
);
|
|
209
|
+
|
|
210
|
+
const { title, summary } = useTitleSummaryOverlay(
|
|
211
|
+
entry,
|
|
212
|
+
playerState?.isLive,
|
|
213
|
+
configuration?.audio_live_player_update_interval
|
|
209
214
|
);
|
|
210
215
|
|
|
216
|
+
const isTablet = useIsTablet();
|
|
217
|
+
|
|
218
|
+
const liveButton = Boolean(value("live_badge_enabled"));
|
|
219
|
+
|
|
211
220
|
const dockedBackgroundColor = value("docked_player_background_color");
|
|
212
221
|
|
|
213
222
|
const insets = useSafeAreaInsets();
|
|
214
223
|
|
|
215
|
-
if (!layoutState.docked && !startComponentsAnimation) return null;
|
|
216
|
-
|
|
217
224
|
return (
|
|
218
|
-
<
|
|
219
|
-
animationType={ComponentAnimationType.componentAppears}
|
|
225
|
+
<View
|
|
220
226
|
style={[
|
|
221
227
|
styles.container,
|
|
222
|
-
animatedContainerStyle(
|
|
223
|
-
isActiveGesture || layoutState.docked,
|
|
224
|
-
progressBarHeight
|
|
225
|
-
),
|
|
226
228
|
{
|
|
227
|
-
height:
|
|
229
|
+
height:
|
|
230
|
+
minimisedHeight +
|
|
231
|
+
(menuVisible ? bottomTabBarHeight : 0) +
|
|
232
|
+
insets.bottom,
|
|
228
233
|
},
|
|
229
234
|
]}
|
|
230
235
|
>
|
|
231
|
-
{!playerState.isLive
|
|
232
|
-
(layoutState.docked || startComponentsAnimation) ? (
|
|
236
|
+
{!playerState.isLive ? (
|
|
233
237
|
<ProgressBar
|
|
234
|
-
name={"
|
|
238
|
+
name={"shared-docked-layout"}
|
|
235
239
|
content={entry}
|
|
236
240
|
value={value}
|
|
237
241
|
visible
|
|
238
242
|
layoutState={layoutState}
|
|
239
243
|
onPlayerSeek={onPlayerSeek}
|
|
240
244
|
playerState={playerState}
|
|
241
|
-
startComponentsAnimation={
|
|
245
|
+
startComponentsAnimation={noop}
|
|
242
246
|
docked
|
|
243
247
|
/>
|
|
244
248
|
) : null}
|
|
245
249
|
|
|
246
250
|
<View style={styles.content}>
|
|
247
|
-
<View
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
isActiveGesture
|
|
252
|
-
)}
|
|
253
|
-
/>
|
|
254
|
-
<TouchableWithoutFeedback onPress={maximazeVideoModal}>
|
|
255
|
-
<View style={styles.touchableArea}>
|
|
256
|
-
{isActiveGesture || layoutState.docked ? (
|
|
257
|
-
<View
|
|
258
|
-
style={{ width: toNumberWithDefault(100, minimisedHeight) }}
|
|
259
|
-
>
|
|
260
|
-
{ImageComponent || null}
|
|
261
|
-
</View>
|
|
262
|
-
) : (
|
|
263
|
-
<View
|
|
264
|
-
style={playerDimensionsStyle(
|
|
265
|
-
minimisedHeight,
|
|
266
|
-
isActiveGesture || layoutState.docked
|
|
267
|
-
)}
|
|
268
|
-
/>
|
|
269
|
-
)}
|
|
270
|
-
<View
|
|
271
|
-
style={[
|
|
272
|
-
styles.contentInfo,
|
|
273
|
-
{ backgroundColor: dockedBackgroundColor },
|
|
274
|
-
]}
|
|
275
|
-
>
|
|
276
|
-
<ContentInfo
|
|
277
|
-
content={{ ...entry, title, summary }}
|
|
278
|
-
value={value}
|
|
279
|
-
docked
|
|
280
|
-
/>
|
|
251
|
+
<View style={styles.touchableArea}>
|
|
252
|
+
{isActiveGesture || layoutState.docked ? (
|
|
253
|
+
<View style={{ aspectRatio: aspectRatio, height: minimisedHeight }}>
|
|
254
|
+
{ImageComponent || null}
|
|
281
255
|
</View>
|
|
256
|
+
) : (
|
|
257
|
+
<View
|
|
258
|
+
style={playerDimensionsStyle(
|
|
259
|
+
minimisedHeight,
|
|
260
|
+
isActiveGesture || layoutState.docked
|
|
261
|
+
)}
|
|
262
|
+
/>
|
|
263
|
+
)}
|
|
264
|
+
<View
|
|
265
|
+
testID="content-info"
|
|
266
|
+
style={[
|
|
267
|
+
styles.contentInfo,
|
|
268
|
+
{ backgroundColor: dockedBackgroundColor },
|
|
269
|
+
]}
|
|
270
|
+
>
|
|
271
|
+
<ContentInfo
|
|
272
|
+
content={{ ...entry, title, summary }}
|
|
273
|
+
value={value}
|
|
274
|
+
docked
|
|
275
|
+
/>
|
|
282
276
|
</View>
|
|
283
|
-
</
|
|
277
|
+
</View>
|
|
284
278
|
<View
|
|
285
279
|
style={[
|
|
286
280
|
isTablet
|
|
@@ -310,10 +304,10 @@ export const DockedControls = (props: Props) => {
|
|
|
310
304
|
</View>
|
|
311
305
|
<View
|
|
312
306
|
style={{
|
|
313
|
-
height: insets.bottom + bottomTabBarHeight,
|
|
307
|
+
height: insets.bottom + (menuVisible ? bottomTabBarHeight : 0),
|
|
314
308
|
backgroundColor: dockedBackgroundColor,
|
|
315
309
|
}}
|
|
316
310
|
/>
|
|
317
|
-
</
|
|
311
|
+
</View>
|
|
318
312
|
);
|
|
319
313
|
};
|
|
@@ -4,7 +4,6 @@ import {
|
|
|
4
4
|
useSafeAreaFrame,
|
|
5
5
|
useSafeAreaInsets,
|
|
6
6
|
} from "react-native-safe-area-context";
|
|
7
|
-
import { useModalAnimationContext } from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation";
|
|
8
7
|
|
|
9
8
|
import { MOBILE, NAVBAR_HEIGHT } from "./const";
|
|
10
9
|
import { TransportInfo } from "./TransportInfo";
|
|
@@ -12,7 +11,6 @@ import { PlayerImage } from "./PlayerImage";
|
|
|
12
11
|
import { Controls } from "./Controls";
|
|
13
12
|
|
|
14
13
|
import { useMobileLayoutImageSize, useTransportInfoHeight } from "./hooks";
|
|
15
|
-
import { DockedControls } from "./DockedControls";
|
|
16
14
|
import { DEBUG, withDebug } from "./debug";
|
|
17
15
|
import {
|
|
18
16
|
BottomDebugSquare,
|
|
@@ -56,6 +54,7 @@ const mobileStyles = ({
|
|
|
56
54
|
imageSize,
|
|
57
55
|
}): ViewStyle => ({
|
|
58
56
|
height: screenHeight - topInset - bottomInset,
|
|
57
|
+
width: "100%",
|
|
59
58
|
|
|
60
59
|
opacity: imageSize ? 1 : 0, // hide content until imageSize is calculated
|
|
61
60
|
|
|
@@ -77,11 +76,8 @@ export function MobileLayout({
|
|
|
77
76
|
onSkipStart,
|
|
78
77
|
onSkipLive,
|
|
79
78
|
onSpeedButtonPress,
|
|
80
|
-
onCloseVideoModal,
|
|
81
79
|
playbackSpeedName,
|
|
82
80
|
configuration,
|
|
83
|
-
dimensions,
|
|
84
|
-
playNextData,
|
|
85
81
|
title,
|
|
86
82
|
summary,
|
|
87
83
|
}: Props) {
|
|
@@ -89,12 +85,10 @@ export function MobileLayout({
|
|
|
89
85
|
|
|
90
86
|
const { bottom: bottomInset, top: topInset } = useSafeAreaInsets();
|
|
91
87
|
const { height: screenHeight } = useSafeAreaFrame();
|
|
92
|
-
const { progressBarHeight } = useModalAnimationContext();
|
|
93
88
|
|
|
94
89
|
const { imageSize } = useMobileLayoutImageSize();
|
|
95
90
|
|
|
96
|
-
const {
|
|
97
|
-
useTransportInfoHeight();
|
|
91
|
+
const { onLayout: onTransportInfoLayout } = useTransportInfoHeight();
|
|
98
92
|
|
|
99
93
|
const controlsContainerHeight = React.useMemo(() => {
|
|
100
94
|
return (
|
|
@@ -108,10 +102,6 @@ export function MobileLayout({
|
|
|
108
102
|
);
|
|
109
103
|
}, [screenHeight, topInset, imageSize, bottomInset]);
|
|
110
104
|
|
|
111
|
-
const verticalOffsetForImage = React.useMemo(() => {
|
|
112
|
-
return transportInfoHeight + MOBILE.MARGIN_TOP - progressBarHeight;
|
|
113
|
-
}, [transportInfoHeight, progressBarHeight]);
|
|
114
|
-
|
|
115
105
|
return (
|
|
116
106
|
<View
|
|
117
107
|
style={[
|
|
@@ -163,19 +153,9 @@ export function MobileLayout({
|
|
|
163
153
|
>
|
|
164
154
|
<PlayerImage
|
|
165
155
|
entry={entry}
|
|
166
|
-
|
|
167
|
-
playerState={playerState}
|
|
168
|
-
value={value}
|
|
169
|
-
configuration={configuration}
|
|
170
|
-
onPlayerSeek={onPlayerSeek}
|
|
171
|
-
onCloseVideoModal={onCloseVideoModal}
|
|
172
|
-
dimensions={dimensions}
|
|
173
|
-
playNextData={playNextData}
|
|
174
|
-
title={title}
|
|
175
|
-
summary={summary}
|
|
176
|
-
docked={docked}
|
|
156
|
+
docked={false}
|
|
177
157
|
imageWidth={imageSize}
|
|
178
|
-
|
|
158
|
+
configuration={configuration}
|
|
179
159
|
/>
|
|
180
160
|
</View>
|
|
181
161
|
{/* PlayerImage */}
|
|
@@ -204,19 +184,6 @@ export function MobileLayout({
|
|
|
204
184
|
/>
|
|
205
185
|
</View>
|
|
206
186
|
</View>
|
|
207
|
-
|
|
208
|
-
<DockedControls
|
|
209
|
-
entry={entry}
|
|
210
|
-
layoutState={layoutState}
|
|
211
|
-
playerState={playerState}
|
|
212
|
-
value={value}
|
|
213
|
-
dimensions={dimensions}
|
|
214
|
-
onCloseVideoModal={onCloseVideoModal}
|
|
215
|
-
onPlayerSeek={onPlayerSeek}
|
|
216
|
-
playNextData={playNextData}
|
|
217
|
-
title={title}
|
|
218
|
-
summary={summary}
|
|
219
|
-
/>
|
|
220
187
|
</View>
|
|
221
188
|
);
|
|
222
189
|
}
|