@applicaster/quick-brick-player 13.0.0-alpha.6234681660 → 13.0.0-alpha.6400875052
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 +5 -5
- package/src/Player/AudioLayer/AudioDescription.tsx +6 -4
- package/src/Player/AudioLayer/AudioPlayerWrapper.tsx +42 -71
- package/src/Player/AudioLayer/Layout/DefaultLayout.tsx +495 -0
- package/src/Player/AudioLayer/Layout/{DockedControls/index.tsx → DockedLayout.tsx} +38 -27
- package/src/Player/AudioLayer/Layout/{Controls/utils.ts → defaultLayoutsConts.ts} +10 -2
- package/src/Player/AudioLayer/Layout/index.tsx +38 -42
- package/src/Player/Const/sleepTimerOptions.ts +10 -0
- package/src/Player/Const/speedOptions.ts +4 -0
- package/src/Player/Utils/index.tsx +117 -0
- package/src/Player/index.tsx +4 -1
- package/src/Player/AudioLayer/Layout/Controls/VerticalGutter.tsx +0 -27
- package/src/Player/AudioLayer/Layout/Controls/index.tsx +0 -307
- package/src/Player/AudioLayer/Layout/MobileLayout.tsx +0 -209
- package/src/Player/AudioLayer/Layout/PlayerImage/ScaledImage.tsx +0 -83
- package/src/Player/AudioLayer/Layout/PlayerImage/StaticImage.tsx +0 -32
- package/src/Player/AudioLayer/Layout/PlayerImage/index.tsx +0 -92
- package/src/Player/AudioLayer/Layout/PlayerImage/styles.ts +0 -17
- package/src/Player/AudioLayer/Layout/TabletLandscapeLayout.tsx +0 -206
- package/src/Player/AudioLayer/Layout/TabletPortraitLayout.tsx +0 -218
- package/src/Player/AudioLayer/Layout/TransportInfo/index.tsx +0 -103
- package/src/Player/AudioLayer/Layout/VerticalGutter/index.tsx +0 -8
- package/src/Player/AudioLayer/Layout/const.ts +0 -19
- package/src/Player/AudioLayer/Layout/debug.ts +0 -5
- package/src/Player/AudioLayer/Layout/hooks/index.ts +0 -3
- package/src/Player/AudioLayer/Layout/hooks/useImageSize.ts +0 -93
- package/src/Player/AudioLayer/Layout/hooks/useTransportInfoHeight.ts +0 -54
- package/src/Player/AudioLayer/Layout/types.ts +0 -49
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applicaster/quick-brick-player",
|
|
3
|
-
"version": "13.0.0-alpha.
|
|
3
|
+
"version": "13.0.0-alpha.6400875052",
|
|
4
4
|
"description": "Quick Brick Player",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -35,11 +35,11 @@
|
|
|
35
35
|
},
|
|
36
36
|
"homepage": "https://github.com/applicaster/quickbrick#readme",
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@applicaster/quick-brick-mobile-transport-controls": "13.0.0-
|
|
38
|
+
"@applicaster/quick-brick-mobile-transport-controls": "13.0.0-rc.88",
|
|
39
39
|
"@applicaster/quick-brick-tv-transport-controls": "13.0.0-rc.56",
|
|
40
|
-
"@applicaster/zapp-react-native-tvos-app": "13.0.0-alpha.
|
|
41
|
-
"@applicaster/zapp-react-native-ui-components": "13.0.0-alpha.
|
|
42
|
-
"@applicaster/zapp-react-native-utils": "13.0.0-alpha.
|
|
40
|
+
"@applicaster/zapp-react-native-tvos-app": "13.0.0-alpha.6400875052",
|
|
41
|
+
"@applicaster/zapp-react-native-ui-components": "13.0.0-alpha.6400875052",
|
|
42
|
+
"@applicaster/zapp-react-native-utils": "13.0.0-alpha.6400875052",
|
|
43
43
|
"keymirror": "^0.1.1",
|
|
44
44
|
"query-string": "7.1.3",
|
|
45
45
|
"react-native-web-linear-gradient": "1.1.2",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { Text, TextStyle } from "react-native";
|
|
2
|
+
import { Text, TextStyle, View } from "react-native";
|
|
3
3
|
import { platformSelect } from "@applicaster/zapp-react-native-utils/reactUtils";
|
|
4
4
|
|
|
5
5
|
type AudioDescriptionProps = {
|
|
@@ -13,6 +13,8 @@ type AudioDescriptionProps = {
|
|
|
13
13
|
value: GetValue;
|
|
14
14
|
};
|
|
15
15
|
|
|
16
|
+
const containerStyles = { paddingTop: 32, paddingBottom: 12 };
|
|
17
|
+
|
|
16
18
|
const titleStyles = (value: GetValue, prefix: string): TextStyle => ({
|
|
17
19
|
textAlign: "left",
|
|
18
20
|
color: value(`${prefix}title_color`),
|
|
@@ -81,13 +83,13 @@ export const AudioDescription = (props: AudioDescriptionProps) => {
|
|
|
81
83
|
const prefix = layoutState.docked ? "docked_player_" : "";
|
|
82
84
|
|
|
83
85
|
return (
|
|
84
|
-
|
|
86
|
+
<View style={containerStyles}>
|
|
85
87
|
<Text style={titleStyles(value, prefix)} numberOfLines={1}>
|
|
86
88
|
{title}
|
|
87
89
|
</Text>
|
|
88
|
-
<Text style={summaryStyles(value, prefix)} numberOfLines={
|
|
90
|
+
<Text style={summaryStyles(value, prefix)} numberOfLines={2}>
|
|
89
91
|
{summary}
|
|
90
92
|
</Text>
|
|
91
|
-
|
|
93
|
+
</View>
|
|
92
94
|
);
|
|
93
95
|
};
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
StyleSheet,
|
|
4
|
+
ViewStyle,
|
|
5
|
+
View,
|
|
6
|
+
Dimensions as ScreenDimensions,
|
|
7
|
+
} from "react-native";
|
|
3
8
|
|
|
4
9
|
import { SafeAreaView, Edge } from "react-native-safe-area-context";
|
|
5
10
|
import { usePlayerState } from "@applicaster/zapp-react-native-utils/appUtils/playerManager/usePlayerState";
|
|
@@ -18,22 +23,23 @@ import { isTV } from "@applicaster/zapp-react-native-utils/reactUtils";
|
|
|
18
23
|
import { useEffect, useState } from "react";
|
|
19
24
|
import { MagicBG } from "./MagicBG";
|
|
20
25
|
import { formatSpeed } from "./utils";
|
|
21
|
-
import {
|
|
26
|
+
import {
|
|
27
|
+
addQueryParam,
|
|
28
|
+
getBottomSheetModalDefaultItemIcon,
|
|
29
|
+
getBottomSheetModalIconProps,
|
|
30
|
+
getBottomSheetModalItemProps,
|
|
31
|
+
getBottomSheetModalLabelProps,
|
|
32
|
+
getBottomSheetModalSelectedItemIcon,
|
|
33
|
+
getLiveUrl,
|
|
34
|
+
} from "../Utils";
|
|
22
35
|
import { useTitleSummaryOverlay } from "@applicaster/zapp-react-native-utils/appUtils/playerManager/usePlayerTitleSummaryOverlay";
|
|
23
36
|
import {
|
|
24
37
|
AnimationComponent,
|
|
25
38
|
ComponentAnimationType,
|
|
26
39
|
AnimatedScrollModal,
|
|
27
40
|
} from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation";
|
|
28
|
-
import { PADDING_HORIZONTAL } from "./Layout/
|
|
41
|
+
import { PADDING_HORIZONTAL } from "./Layout/defaultLayoutsConts";
|
|
29
42
|
import { toNumberWithDefault } from "@applicaster/zapp-react-native-utils/numberUtils";
|
|
30
|
-
import {
|
|
31
|
-
speed_0_8,
|
|
32
|
-
speed_1,
|
|
33
|
-
speed_1_2,
|
|
34
|
-
speed_1_5,
|
|
35
|
-
speed_2,
|
|
36
|
-
} from "@applicaster/quick-brick-mobile-transport-controls";
|
|
37
43
|
import {
|
|
38
44
|
SleepTimerController,
|
|
39
45
|
SleepTimerState,
|
|
@@ -42,6 +48,9 @@ import {
|
|
|
42
48
|
import { SpeedController, PlaybackSpeed, DEFAULT_SPEED } from "./SpeedManager";
|
|
43
49
|
import { imageSrcFromMediaItem } from "@applicaster/zapp-react-native-utils/configurationUtils";
|
|
44
50
|
import { useTheme } from "@applicaster/zapp-react-native-utils/theme";
|
|
51
|
+
import { openBottomSheetModal } from "@applicaster/zapp-react-native-utils/modalState";
|
|
52
|
+
import { sleepTimerOptions } from "../Const/sleepTimerOptions";
|
|
53
|
+
import { speedOptions } from "../Const/speedOptions";
|
|
45
54
|
|
|
46
55
|
const { log_debug } = createLogger({
|
|
47
56
|
subsystem: "UIComponent",
|
|
@@ -83,51 +92,17 @@ type Props = {
|
|
|
83
92
|
|
|
84
93
|
const { width: SCREEN_WIDTH } = ScreenDimensions.get("screen");
|
|
85
94
|
|
|
86
|
-
const Styles = {
|
|
87
|
-
mainContainer: (style: ViewStyle) => {
|
|
88
|
-
const combinedStyle: ViewStyle = {
|
|
89
|
-
flex: 1,
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
return {
|
|
93
|
-
...combinedStyle,
|
|
94
|
-
...style,
|
|
95
|
-
};
|
|
96
|
-
},
|
|
95
|
+
const Styles = StyleSheet.create({
|
|
97
96
|
playerContainer: {
|
|
98
97
|
flex: 1,
|
|
99
98
|
},
|
|
100
99
|
paddingHorizontal: { paddingTop: 0, paddingHorizontal: PADDING_HORIZONTAL },
|
|
101
|
-
|
|
102
|
-
controlsMobile: {
|
|
103
|
-
height: 50,
|
|
104
|
-
marginHorizontal: 24,
|
|
105
|
-
},
|
|
106
|
-
controlsTablet: {
|
|
107
|
-
height: 96,
|
|
108
|
-
marginHorizontal: 24,
|
|
109
|
-
},
|
|
110
100
|
playerDetails: {
|
|
111
101
|
marginTop: 60,
|
|
112
102
|
alignSelf: "center",
|
|
113
103
|
width: SCREEN_WIDTH - PADDING_HORIZONTAL * 2,
|
|
114
104
|
},
|
|
115
|
-
|
|
116
|
-
linearGradient: {
|
|
117
|
-
flex: 1,
|
|
118
|
-
},
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
const sleeps = [
|
|
122
|
-
// { label: "End of episode", value: "episode" },
|
|
123
|
-
{ label: "5 minutes", value: 5 },
|
|
124
|
-
{ label: "10 minutes", value: 10 },
|
|
125
|
-
{ label: "15 minutes", value: 15 },
|
|
126
|
-
{ label: "30 minutes", value: 30 },
|
|
127
|
-
{ label: "45 minutes", value: 45 },
|
|
128
|
-
{ label: "1 hour", value: 60 },
|
|
129
|
-
{ label: "2 hours", value: 120 },
|
|
130
|
-
];
|
|
105
|
+
});
|
|
131
106
|
|
|
132
107
|
const edges: Edge[] = ["right", "left", "top"];
|
|
133
108
|
|
|
@@ -147,14 +122,6 @@ export const AudioPlayerWrapper: React.FC<Props> = (props: Props) => {
|
|
|
147
122
|
isTabletPortrait,
|
|
148
123
|
} = props;
|
|
149
124
|
|
|
150
|
-
const speeds = [
|
|
151
|
-
{ asset: configuration["speed_0_8"] || speed_0_8, value: 0.8 },
|
|
152
|
-
{ asset: configuration["speed_1"] || speed_1, value: 1.0 },
|
|
153
|
-
{ asset: configuration["speed_1_2"] || speed_1_2, value: 1.2 },
|
|
154
|
-
{ asset: configuration["speed_1_5"] || speed_1_5, value: 1.5 },
|
|
155
|
-
{ asset: configuration["speed_2"] || speed_2, value: 2.0 },
|
|
156
|
-
];
|
|
157
|
-
|
|
158
125
|
const isTablet = useIsTablet();
|
|
159
126
|
|
|
160
127
|
const isTabletLandscape = !isTV() && isTablet && !isTabletPortrait;
|
|
@@ -202,8 +169,6 @@ export const AudioPlayerWrapper: React.FC<Props> = (props: Props) => {
|
|
|
202
169
|
height: 0,
|
|
203
170
|
});
|
|
204
171
|
|
|
205
|
-
const navigator = useNavigation();
|
|
206
|
-
|
|
207
172
|
const { maximiseVideoModal } = useNavigation();
|
|
208
173
|
|
|
209
174
|
const onLayout = (event: any) => {
|
|
@@ -293,44 +258,48 @@ export const AudioPlayerWrapper: React.FC<Props> = (props: Props) => {
|
|
|
293
258
|
);
|
|
294
259
|
|
|
295
260
|
const onSpeedButtonPress = React.useCallback(() => {
|
|
296
|
-
|
|
261
|
+
openBottomSheetModal({
|
|
297
262
|
modalBottomSheetContentProps: {
|
|
298
|
-
items:
|
|
263
|
+
items: speedOptions,
|
|
299
264
|
current_selection: playbackSpeed,
|
|
300
265
|
onPress: onSpeedSelect,
|
|
301
266
|
title: configuration["playback_speed_title"],
|
|
267
|
+
itemProps: getBottomSheetModalItemProps,
|
|
268
|
+
iconProps: getBottomSheetModalIconProps,
|
|
269
|
+
labelProps: getBottomSheetModalLabelProps,
|
|
270
|
+
getSelectedItemIcon: getBottomSheetModalSelectedItemIcon,
|
|
271
|
+
getDefaultItemIcon: getBottomSheetModalDefaultItemIcon,
|
|
272
|
+
iconPlacement: "right",
|
|
302
273
|
},
|
|
303
274
|
options: {
|
|
304
275
|
supportedOrientations: ["portrait"],
|
|
305
276
|
},
|
|
306
277
|
});
|
|
307
|
-
}, [
|
|
308
|
-
playbackSpeed,
|
|
309
|
-
setPlaybackSpeed,
|
|
310
|
-
navigator,
|
|
311
|
-
onSpeedSelect,
|
|
312
|
-
configuration["playback_speed_title"],
|
|
313
|
-
]);
|
|
278
|
+
}, [playbackSpeed, onSpeedSelect, configuration["playback_speed_title"]]);
|
|
314
279
|
|
|
315
280
|
const onSleepButtonPress = React.useCallback(() => {
|
|
316
|
-
|
|
281
|
+
openBottomSheetModal({
|
|
317
282
|
modalBottomSheetContentProps: {
|
|
318
283
|
items: [
|
|
319
284
|
{
|
|
320
285
|
label: configuration["playback_sleep_off_label"],
|
|
321
286
|
value: 0,
|
|
322
287
|
},
|
|
323
|
-
].concat(
|
|
288
|
+
].concat(sleepTimerOptions),
|
|
324
289
|
current_selection: sleepTimerState.timer,
|
|
325
290
|
onPress: onSleepSelect,
|
|
326
291
|
title: configuration["playback_sleep_title"],
|
|
292
|
+
itemProps: getBottomSheetModalItemProps,
|
|
293
|
+
iconProps: getBottomSheetModalIconProps,
|
|
294
|
+
labelProps: getBottomSheetModalLabelProps,
|
|
295
|
+
getSelectedItemIcon: getBottomSheetModalSelectedItemIcon,
|
|
296
|
+
iconPlacement: "right",
|
|
327
297
|
},
|
|
328
298
|
options: {
|
|
329
299
|
supportedOrientations: ["portrait"],
|
|
330
300
|
},
|
|
331
301
|
});
|
|
332
302
|
}, [
|
|
333
|
-
navigator,
|
|
334
303
|
sleepTimerState.timer,
|
|
335
304
|
configuration["playback_sleep_title"],
|
|
336
305
|
configuration["playback_sleep_off_label"],
|
|
@@ -364,9 +333,11 @@ export const AudioPlayerWrapper: React.FC<Props> = (props: Props) => {
|
|
|
364
333
|
player?.seekTo(0);
|
|
365
334
|
}, [player]);
|
|
366
335
|
|
|
336
|
+
const ContainerView = SafeAreaView;
|
|
337
|
+
|
|
367
338
|
const MainContent = React.useMemo(() => {
|
|
368
339
|
return (
|
|
369
|
-
<
|
|
340
|
+
<ContainerView style={[style, Styles.playerContainer]} edges={edges}>
|
|
370
341
|
<AnimationComponent
|
|
371
342
|
animationType={ComponentAnimationType.moveUpComponent}
|
|
372
343
|
additionalData={{ saveArea: true }}
|
|
@@ -410,18 +381,18 @@ export const AudioPlayerWrapper: React.FC<Props> = (props: Props) => {
|
|
|
410
381
|
animationType={ComponentAnimationType.componentFade}
|
|
411
382
|
>
|
|
412
383
|
<PlayerDetails
|
|
384
|
+
isAudioPlayer
|
|
413
385
|
configuration={configuration}
|
|
414
386
|
style={Styles.playerDetails}
|
|
415
387
|
entry={entry}
|
|
416
388
|
isTabletLandscape={isTabletLandscape}
|
|
417
|
-
isAudioPlayer={true}
|
|
418
389
|
/>
|
|
419
390
|
</AnimationComponent>
|
|
420
391
|
</View>
|
|
421
392
|
</View>
|
|
422
393
|
</AnimatedScrollModal>
|
|
423
394
|
</AnimationComponent>
|
|
424
|
-
</
|
|
395
|
+
</ContainerView>
|
|
425
396
|
);
|
|
426
397
|
}, [
|
|
427
398
|
docked,
|