@applicaster/quick-brick-player 14.0.0-rc.8 → 14.0.0-rc.80
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 +28 -88
- package/src/Player/AudioLayer/Layout/Controls/index.tsx +8 -18
- package/src/Player/AudioLayer/Layout/DockedControls/index.tsx +119 -125
- package/src/Player/AudioLayer/Layout/MobileLayout.tsx +5 -38
- package/src/Player/AudioLayer/Layout/PlayerImage/AnimatedImage.tsx +3 -8
- package/src/Player/AudioLayer/Layout/PlayerImage/FlexImage.tsx +5 -9
- 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 +6 -18
- package/src/Player/AudioLayer/components/SleepTimerModalHeader/SleepTimerModalHeader.tsx +1 -1
- package/src/Player/PlayerModal/GestureAnimatedScrollView.ts +7 -0
- package/src/Player/PlayerModal/PlayerModal.tsx +115 -0
- package/src/Player/PlayerModal/VideoPlayerModal.tsx +271 -0
- package/src/Player/PlayerModal/consts/index.ts +17 -0
- package/src/Player/PlayerModal/context/index.ts +6 -0
- package/src/Player/PlayerModal/hooks/index.ts +201 -0
- package/src/Player/PlayerModal/index.ts +3 -0
- package/src/Player/PlayerModal/index.web.ts +5 -0
- package/src/Player/PlayerModal/styles.ts +104 -0
- package/src/Player/PlayerModal/utils/index.ts +29 -0
- package/src/Player/PlayerView/GenericTVPlayerView.tsx +42 -0
- package/src/Player/PlayerView/TVPlayerView.tsx +26 -0
- package/src/Player/PlayerView/TvOSPlayerView.tsx +51 -0
- package/src/Player/PlayerView/types.ts +41 -0
- package/src/Player/index.tsx +574 -380
- package/src/QuickBrickPlayer.tsx +16 -10
- package/src/utils/dimensions.ts +29 -0
- package/src/utils/index.ts +12 -0
- package/src/utils/logger.ts +6 -0
- package/src/utils/playerHelpers.ts +11 -0
- package/src/utils/playerStyles.ts +50 -0
- /package/src/Player/AudioLayer/Layout/{Debug → DebugComponent}/index.tsx +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applicaster/quick-brick-player",
|
|
3
|
-
"version": "14.0.0-rc.
|
|
3
|
+
"version": "14.0.0-rc.80",
|
|
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": "
|
|
39
|
-
"@applicaster/quick-brick-tv-transport-controls": "14.0.0-rc.
|
|
40
|
-
"@applicaster/zapp-react-native-tvos-app": "14.0.0-rc.
|
|
41
|
-
"@applicaster/zapp-react-native-ui-components": "14.0.0-rc.
|
|
42
|
-
"@applicaster/zapp-react-native-utils": "14.0.0-rc.
|
|
38
|
+
"@applicaster/quick-brick-mobile-transport-controls": "14.0.0-rc.67",
|
|
39
|
+
"@applicaster/quick-brick-tv-transport-controls": "14.0.0-rc.71",
|
|
40
|
+
"@applicaster/zapp-react-native-tvos-app": "14.0.0-rc.80",
|
|
41
|
+
"@applicaster/zapp-react-native-ui-components": "14.0.0-rc.80",
|
|
42
|
+
"@applicaster/zapp-react-native-utils": "14.0.0-rc.80",
|
|
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,
|
|
@@ -128,11 +99,7 @@ export const AudioPlayerWrapper: React.FC<Props> = (props: Props) => {
|
|
|
128
99
|
);
|
|
129
100
|
|
|
130
101
|
useEffect(() => {
|
|
131
|
-
|
|
132
|
-
setSpeedManager(new SpeedController(player));
|
|
133
|
-
} else {
|
|
134
|
-
setSpeedManager(null);
|
|
135
|
-
}
|
|
102
|
+
setSpeedManager(player ? new SpeedController(player) : null);
|
|
136
103
|
}, [player]);
|
|
137
104
|
|
|
138
105
|
useEffect(() => {
|
|
@@ -246,7 +213,7 @@ export const AudioPlayerWrapper: React.FC<Props> = (props: Props) => {
|
|
|
246
213
|
items: speedOptions,
|
|
247
214
|
current_selection: playbackSpeed,
|
|
248
215
|
onPress: onSpeedSelect,
|
|
249
|
-
title: configuration
|
|
216
|
+
title: configuration.playback_speed_title,
|
|
250
217
|
itemProps: getBottomSheetModalItemProps,
|
|
251
218
|
iconProps: getBottomSheetModalIconProps,
|
|
252
219
|
labelProps: getBottomSheetModalLabelProps,
|
|
@@ -262,11 +229,7 @@ export const AudioPlayerWrapper: React.FC<Props> = (props: Props) => {
|
|
|
262
229
|
],
|
|
263
230
|
},
|
|
264
231
|
});
|
|
265
|
-
}, [playbackSpeed, onSpeedSelect, configuration
|
|
266
|
-
|
|
267
|
-
const onCloseVideoModal = React.useCallback(() => {
|
|
268
|
-
playerManager.close();
|
|
269
|
-
}, [playerManager]);
|
|
232
|
+
}, [playbackSpeed, onSpeedSelect, configuration.playback_speed_title]);
|
|
270
233
|
|
|
271
234
|
const onPlayerSeek = React.useCallback(
|
|
272
235
|
(targetTime: number) => {
|
|
@@ -285,51 +248,28 @@ export const AudioPlayerWrapper: React.FC<Props> = (props: Props) => {
|
|
|
285
248
|
|
|
286
249
|
return (
|
|
287
250
|
<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>
|
|
251
|
+
<View style={Styles.playerContainer} onLayout={onLayout}>
|
|
252
|
+
<Layout
|
|
253
|
+
entry={entry}
|
|
254
|
+
playerState={playerState}
|
|
255
|
+
layoutState={layoutState}
|
|
256
|
+
value={value}
|
|
257
|
+
onPlaybackButtonPress={onPlaybackButtonPress}
|
|
258
|
+
onRewindButtonPress={onRewindButtonPress}
|
|
259
|
+
onForwardButtonPress={onForwardButtonPress}
|
|
260
|
+
onPlayerSeek={onPlayerSeek}
|
|
261
|
+
onSkipStart={onSkipStart}
|
|
262
|
+
onSpeedButtonPress={onSpeedButtonPress}
|
|
263
|
+
playbackSpeedName={formatSpeed(playbackSpeed.value)}
|
|
264
|
+
onSkipLive={onSkipLive}
|
|
265
|
+
maximiseVideoModal={maximiseVideoModal}
|
|
266
|
+
configuration={configuration}
|
|
267
|
+
dimensions={dimensions}
|
|
268
|
+
playNextData={playNextData}
|
|
269
|
+
title={title}
|
|
270
|
+
summary={summary}
|
|
271
|
+
/>
|
|
272
|
+
</View>
|
|
333
273
|
</SafeAreaView>
|
|
334
274
|
);
|
|
335
275
|
};
|
|
@@ -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,30 +16,28 @@ 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
|
+
import { usePlugins } from "@applicaster/zapp-react-native-redux";
|
|
29
30
|
|
|
30
31
|
const bottomTabBarHeight = getTabBarHeight();
|
|
31
32
|
|
|
32
33
|
type Props = {
|
|
33
34
|
entry: ZappEntry;
|
|
34
35
|
layoutState: QuickBrickPlayer.LayoutState;
|
|
35
|
-
|
|
36
|
-
value: GetValue;
|
|
37
|
-
dimensions: QuickBrickPlayer.AudioPlayerProps["dimensions"];
|
|
38
|
-
onCloseVideoModal: () => void;
|
|
39
|
-
onPlayerSeek: (targetTime: number) => void;
|
|
36
|
+
onPlayerSeek?: (targetTime: number) => void;
|
|
40
37
|
playNextData: PlayNextData;
|
|
41
|
-
title: string | number;
|
|
42
|
-
summary: string | number;
|
|
43
38
|
ImageComponent?: React.ReactNode;
|
|
39
|
+
isActiveGesture?: boolean;
|
|
40
|
+
aspectRatio?: number;
|
|
44
41
|
};
|
|
45
42
|
|
|
46
43
|
const styles = StyleSheet.create({
|
|
@@ -48,6 +45,7 @@ const styles = StyleSheet.create({
|
|
|
48
45
|
flex: 1,
|
|
49
46
|
flexDirection: "column",
|
|
50
47
|
alignItems: "stretch",
|
|
48
|
+
marginTop: PROGRESS_BAR_HEIGHT,
|
|
51
49
|
},
|
|
52
50
|
content: {
|
|
53
51
|
flex: 1,
|
|
@@ -99,26 +97,6 @@ const playerDimensionsStyle = (
|
|
|
99
97
|
width: addPadding ? toNumberWithDefault(100, minimisedHeight) : 0,
|
|
100
98
|
});
|
|
101
99
|
|
|
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
100
|
const controlButtons = (
|
|
123
101
|
live: boolean,
|
|
124
102
|
paused: boolean,
|
|
@@ -180,82 +158,97 @@ export const DockedControls = (props: Props) => {
|
|
|
180
158
|
const {
|
|
181
159
|
entry,
|
|
182
160
|
layoutState,
|
|
183
|
-
|
|
184
|
-
value,
|
|
185
|
-
dimensions,
|
|
186
|
-
onCloseVideoModal,
|
|
187
|
-
onPlayerSeek,
|
|
161
|
+
onPlayerSeek = noop,
|
|
188
162
|
playNextData,
|
|
189
|
-
title,
|
|
190
|
-
summary,
|
|
191
163
|
ImageComponent,
|
|
164
|
+
isActiveGesture = true,
|
|
165
|
+
aspectRatio,
|
|
192
166
|
} = props;
|
|
193
167
|
|
|
194
|
-
const
|
|
168
|
+
const onCloseVideoModal = React.useCallback(() => {
|
|
169
|
+
playerManager.close();
|
|
170
|
+
}, []);
|
|
195
171
|
|
|
196
|
-
const
|
|
172
|
+
const { currentRoute, screenData } = useNavigation();
|
|
197
173
|
|
|
198
|
-
const
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
minimisedHeight,
|
|
203
|
-
progressBarHeight,
|
|
204
|
-
} = useModalAnimationContext();
|
|
174
|
+
const plugins = usePlugins();
|
|
175
|
+
const menuVisible = isMenuVisible(currentRoute, screenData, plugins);
|
|
176
|
+
|
|
177
|
+
const { minimised_height: minimisedHeight } = useConfiguration();
|
|
205
178
|
|
|
206
|
-
const
|
|
207
|
-
|
|
179
|
+
const configuration = useZStore("playerConfiguration")();
|
|
180
|
+
const playerState = usePlayerState("shared-player-wrapper-docked");
|
|
181
|
+
|
|
182
|
+
const getValue = React.useCallback(
|
|
183
|
+
(key: string, stylesObj: {}) => R.propOr(null, key, stylesObj),
|
|
208
184
|
[]
|
|
209
185
|
);
|
|
210
186
|
|
|
187
|
+
const value = React.useCallback(
|
|
188
|
+
(key: string) => {
|
|
189
|
+
const retVal = getValue(key, configuration);
|
|
190
|
+
|
|
191
|
+
const minimumAllowedSeekableDurationInSeconds = getValue(
|
|
192
|
+
"minimumAllowedSeekableDurationInSeconds",
|
|
193
|
+
configuration
|
|
194
|
+
);
|
|
195
|
+
|
|
196
|
+
if (key === "liveSeekingEnabled") {
|
|
197
|
+
return playerState.seekableDuration <
|
|
198
|
+
minimumAllowedSeekableDurationInSeconds || playerManager.isCasting()
|
|
199
|
+
? false
|
|
200
|
+
: retVal;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
return retVal;
|
|
204
|
+
},
|
|
205
|
+
[...Object.values(configuration), playerState.seekableDuration, getValue]
|
|
206
|
+
);
|
|
207
|
+
|
|
208
|
+
const { title, summary } = useTitleSummaryOverlay(
|
|
209
|
+
entry,
|
|
210
|
+
playerState?.isLive,
|
|
211
|
+
configuration?.audio_live_player_update_interval
|
|
212
|
+
);
|
|
213
|
+
|
|
214
|
+
const isTablet = useIsTablet();
|
|
215
|
+
|
|
216
|
+
const liveButton = Boolean(value("live_badge_enabled"));
|
|
217
|
+
|
|
211
218
|
const dockedBackgroundColor = value("docked_player_background_color");
|
|
212
219
|
|
|
213
220
|
const insets = useSafeAreaInsets();
|
|
214
221
|
|
|
215
|
-
if (!layoutState.docked && !startComponentsAnimation) return null;
|
|
216
|
-
|
|
217
222
|
return (
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
startComponentsAnimation={startComponentsAnimation}
|
|
242
|
-
docked
|
|
243
|
-
/>
|
|
244
|
-
) : null}
|
|
223
|
+
<>
|
|
224
|
+
<View
|
|
225
|
+
style={[
|
|
226
|
+
styles.container,
|
|
227
|
+
{
|
|
228
|
+
height: minimisedHeight,
|
|
229
|
+
maxHeight: minimisedHeight,
|
|
230
|
+
},
|
|
231
|
+
]}
|
|
232
|
+
>
|
|
233
|
+
{!playerState.isLive ? (
|
|
234
|
+
<ProgressBar
|
|
235
|
+
name={"shared-docked-layout"}
|
|
236
|
+
content={entry}
|
|
237
|
+
value={value}
|
|
238
|
+
visible
|
|
239
|
+
layoutState={layoutState}
|
|
240
|
+
onPlayerSeek={onPlayerSeek}
|
|
241
|
+
playerState={playerState}
|
|
242
|
+
startComponentsAnimation={noop}
|
|
243
|
+
docked
|
|
244
|
+
/>
|
|
245
|
+
) : null}
|
|
245
246
|
|
|
246
|
-
|
|
247
|
-
<View
|
|
248
|
-
style={backgroundImageStyle(
|
|
249
|
-
dimensions,
|
|
250
|
-
minimisedHeight,
|
|
251
|
-
isActiveGesture
|
|
252
|
-
)}
|
|
253
|
-
/>
|
|
254
|
-
<TouchableWithoutFeedback onPress={maximazeVideoModal}>
|
|
247
|
+
<View style={styles.content}>
|
|
255
248
|
<View style={styles.touchableArea}>
|
|
256
249
|
{isActiveGesture || layoutState.docked ? (
|
|
257
250
|
<View
|
|
258
|
-
style={{
|
|
251
|
+
style={{ aspectRatio: aspectRatio, height: minimisedHeight }}
|
|
259
252
|
>
|
|
260
253
|
{ImageComponent || null}
|
|
261
254
|
</View>
|
|
@@ -268,6 +261,7 @@ export const DockedControls = (props: Props) => {
|
|
|
268
261
|
/>
|
|
269
262
|
)}
|
|
270
263
|
<View
|
|
264
|
+
testID="content-info"
|
|
271
265
|
style={[
|
|
272
266
|
styles.contentInfo,
|
|
273
267
|
{ backgroundColor: dockedBackgroundColor },
|
|
@@ -280,40 +274,40 @@ export const DockedControls = (props: Props) => {
|
|
|
280
274
|
/>
|
|
281
275
|
</View>
|
|
282
276
|
</View>
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
:
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
277
|
+
<View
|
|
278
|
+
style={[
|
|
279
|
+
isTablet
|
|
280
|
+
? styles.controlsContainerForTablet
|
|
281
|
+
: styles.controlsContainerForMobile,
|
|
282
|
+
{ backgroundColor: dockedBackgroundColor },
|
|
283
|
+
]}
|
|
284
|
+
>
|
|
285
|
+
<Controls
|
|
286
|
+
value={value}
|
|
287
|
+
visible
|
|
288
|
+
buttons={R.partial(controlButtons, [
|
|
289
|
+
playerState.isLive && liveButton,
|
|
290
|
+
])}
|
|
291
|
+
style={styles.playPauseButton}
|
|
292
|
+
playNextData={playNextData}
|
|
293
|
+
playerState={playerState}
|
|
294
|
+
/>
|
|
295
|
+
<Button
|
|
296
|
+
icon={"close_mini"}
|
|
297
|
+
size={"medium"}
|
|
298
|
+
value={value}
|
|
299
|
+
onPress={onCloseVideoModal}
|
|
300
|
+
style={styles.buttons}
|
|
301
|
+
/>
|
|
302
|
+
</View>
|
|
309
303
|
</View>
|
|
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
|
+
</>
|
|
318
312
|
);
|
|
319
313
|
};
|