@applicaster/quick-brick-player 13.0.0-rc.64 → 13.0.0-rc.66
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/AudioPlayerWrapper.tsx +10 -2
- package/src/Player/AudioLayer/Layout/DefaultLayout.tsx +29 -17
- package/src/Player/AudioLayer/Layout/DockedLayout.tsx +1 -1
- package/src/Player/AudioLayer/MagicBG/index.tsx +1 -1
- package/src/Player/AudioLayer/utils.ts +24 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applicaster/quick-brick-player",
|
|
3
|
-
"version": "13.0.0-rc.
|
|
3
|
+
"version": "13.0.0-rc.66",
|
|
4
4
|
"description": "Quick Brick Player",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -36,11 +36,11 @@
|
|
|
36
36
|
},
|
|
37
37
|
"homepage": "https://github.com/applicaster/quickbrick#readme",
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@applicaster/quick-brick-mobile-transport-controls": "13.0.0-rc.
|
|
39
|
+
"@applicaster/quick-brick-mobile-transport-controls": "13.0.0-rc.66",
|
|
40
40
|
"@applicaster/quick-brick-tv-transport-controls": "13.0.0-rc.56",
|
|
41
|
-
"@applicaster/zapp-react-native-tvos-app": "13.0.0-rc.
|
|
42
|
-
"@applicaster/zapp-react-native-ui-components": "13.0.0-rc.
|
|
43
|
-
"@applicaster/zapp-react-native-utils": "13.0.0-rc.
|
|
41
|
+
"@applicaster/zapp-react-native-tvos-app": "13.0.0-rc.66",
|
|
42
|
+
"@applicaster/zapp-react-native-ui-components": "13.0.0-rc.66",
|
|
43
|
+
"@applicaster/zapp-react-native-utils": "13.0.0-rc.66",
|
|
44
44
|
"keymirror": "^0.1.1",
|
|
45
45
|
"query-string": "7.1.3",
|
|
46
46
|
"react-native-web-linear-gradient": "1.1.2",
|
|
@@ -41,6 +41,7 @@ import {
|
|
|
41
41
|
} from "./SleepTimerManager";
|
|
42
42
|
import { SpeedController, PlaybackSpeed, DEFAULT_SPEED } from "./SpeedManager";
|
|
43
43
|
import { imageSrcFromMediaItem } from "@applicaster/zapp-react-native-utils/configurationUtils";
|
|
44
|
+
import { useTheme } from "@applicaster/zapp-react-native-utils/theme";
|
|
44
45
|
|
|
45
46
|
const { log_debug } = createLogger({
|
|
46
47
|
subsystem: "UIComponent",
|
|
@@ -58,6 +59,7 @@ type Configuration = {
|
|
|
58
59
|
[key: string]: any;
|
|
59
60
|
magic_background?: boolean;
|
|
60
61
|
audio_player_background_image_query?: string;
|
|
62
|
+
audio_player_background_image_default_color?: string;
|
|
61
63
|
tablet_landscape_sidebar_width?: string;
|
|
62
64
|
tablet_landscape_player_container_background_color?: string;
|
|
63
65
|
};
|
|
@@ -130,6 +132,7 @@ const sleeps = [
|
|
|
130
132
|
export const AudioPlayerWrapper: React.FC<Props> = (props: Props) => {
|
|
131
133
|
const player = usePlayer();
|
|
132
134
|
const playerState = usePlayerState("audio-player-wrapper");
|
|
135
|
+
const theme = useTheme();
|
|
133
136
|
|
|
134
137
|
const {
|
|
135
138
|
docked,
|
|
@@ -451,16 +454,21 @@ export const AudioPlayerWrapper: React.FC<Props> = (props: Props) => {
|
|
|
451
454
|
const queryParamName =
|
|
452
455
|
configuration.audio_player_background_image_query || "width";
|
|
453
456
|
|
|
457
|
+
const defaultBackgroundColor =
|
|
458
|
+
configuration.audio_player_background_image_default_color ||
|
|
459
|
+
theme?.app_background_color;
|
|
460
|
+
|
|
454
461
|
const queryParamValue = 15;
|
|
455
462
|
|
|
456
|
-
const url =
|
|
463
|
+
const url =
|
|
464
|
+
baseUrl && addQueryParam(baseUrl, queryParamName, queryParamValue);
|
|
457
465
|
|
|
458
466
|
return (
|
|
459
467
|
<MagicBG
|
|
460
468
|
image={url}
|
|
461
469
|
fallbackUrl={baseUrl}
|
|
462
470
|
colors={entry?.extensions?.backgroundColors}
|
|
463
|
-
defaultColor=
|
|
471
|
+
defaultColor={defaultBackgroundColor}
|
|
464
472
|
>
|
|
465
473
|
{MainContent}
|
|
466
474
|
</MagicBG>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { useEffect, useMemo, useState } from "react";
|
|
3
3
|
import * as R from "ramda";
|
|
4
|
-
import { View } from "react-native";
|
|
4
|
+
import { View, Dimensions as ScreenDimensions } from "react-native";
|
|
5
5
|
import { dayjs } from "@applicaster/zapp-react-native-utils/dateUtils";
|
|
6
6
|
|
|
7
7
|
import {
|
|
@@ -33,8 +33,10 @@ import {
|
|
|
33
33
|
ComponentAnimationType,
|
|
34
34
|
useModalAnimationContext,
|
|
35
35
|
} from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation";
|
|
36
|
+
import { PlayerAnimationStateT } from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation/ModalAnimationContext";
|
|
36
37
|
import DockedLayout from "./DockedLayout";
|
|
37
38
|
import { isValidDate } from "../../Utils";
|
|
39
|
+
import { calculateBorderRadius } from "../utils";
|
|
38
40
|
|
|
39
41
|
type Dimensions = {
|
|
40
42
|
width: number;
|
|
@@ -79,6 +81,8 @@ type LayoutProps = {
|
|
|
79
81
|
defaultDimensions: Dimensions;
|
|
80
82
|
};
|
|
81
83
|
|
|
84
|
+
const { width: SCREEN_WIDTH } = ScreenDimensions.get("screen");
|
|
85
|
+
|
|
82
86
|
const Styles = {
|
|
83
87
|
container: { flex: 1 },
|
|
84
88
|
tabletContainer: (isPortraitMode: boolean) => ({
|
|
@@ -91,6 +95,11 @@ const Styles = {
|
|
|
91
95
|
maxHeight: 750,
|
|
92
96
|
marginTop: 80,
|
|
93
97
|
},
|
|
98
|
+
playerInfoWrapper: {
|
|
99
|
+
flex: 1,
|
|
100
|
+
alignItems: "center",
|
|
101
|
+
justifyContent: "space-between",
|
|
102
|
+
},
|
|
94
103
|
tabletLayout: {
|
|
95
104
|
width: 463,
|
|
96
105
|
marginBottom: 80,
|
|
@@ -101,9 +110,9 @@ const Styles = {
|
|
|
101
110
|
justifyContent: isLiveShowFullControls ? "space-between" : "space-evenly",
|
|
102
111
|
}),
|
|
103
112
|
backgroundImageContainer: (dimensions: Dimensions, isTablet: boolean) => {
|
|
104
|
-
const mobileValue = dimensions
|
|
113
|
+
const mobileValue = dimensions?.width
|
|
105
114
|
? dimensions.width - PADDING_HORIZONTAL * 2
|
|
106
|
-
:
|
|
115
|
+
: SCREEN_WIDTH - PADDING_HORIZONTAL * 2;
|
|
107
116
|
|
|
108
117
|
return {
|
|
109
118
|
width: isTablet ? 463 : mobileValue,
|
|
@@ -114,14 +123,16 @@ const Styles = {
|
|
|
114
123
|
isTablet: boolean,
|
|
115
124
|
docked: boolean,
|
|
116
125
|
startComponentsAnimation: boolean,
|
|
117
|
-
isActiveGesture: boolean
|
|
126
|
+
isActiveGesture: boolean,
|
|
127
|
+
playerAnimationState: PlayerAnimationStateT
|
|
118
128
|
) => ({
|
|
119
|
-
borderRadius:
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
129
|
+
borderRadius: calculateBorderRadius(
|
|
130
|
+
isTablet,
|
|
131
|
+
docked,
|
|
132
|
+
startComponentsAnimation,
|
|
133
|
+
isActiveGesture,
|
|
134
|
+
playerAnimationState
|
|
135
|
+
),
|
|
125
136
|
}),
|
|
126
137
|
|
|
127
138
|
paddingHorizontal: {
|
|
@@ -329,13 +340,11 @@ export default function DefaultLayout(props: LayoutProps) {
|
|
|
329
340
|
const Separator = () => <View style={Styles.separator} />;
|
|
330
341
|
|
|
331
342
|
const defaultImageDimensions = React.useMemo(
|
|
332
|
-
() =>
|
|
333
|
-
defaultDimensions &&
|
|
334
|
-
Styles.backgroundImageContainer(defaultDimensions, isTablet),
|
|
343
|
+
() => Styles.backgroundImageContainer(defaultDimensions, isTablet),
|
|
335
344
|
[defaultDimensions, isTablet]
|
|
336
345
|
);
|
|
337
346
|
|
|
338
|
-
const { isActiveGesture, startComponentsAnimation } =
|
|
347
|
+
const { isActiveGesture, startComponentsAnimation, playerAnimationState } =
|
|
339
348
|
useModalAnimationContext();
|
|
340
349
|
|
|
341
350
|
return (
|
|
@@ -344,7 +353,10 @@ export default function DefaultLayout(props: LayoutProps) {
|
|
|
344
353
|
isTablet ? Styles.tabletContainer(isPortraitMode) : Styles.container
|
|
345
354
|
}
|
|
346
355
|
>
|
|
347
|
-
<AnimationComponent
|
|
356
|
+
<AnimationComponent
|
|
357
|
+
animationType={ComponentAnimationType.componentFade}
|
|
358
|
+
style={isTablet ? Styles.playerInfoWrapper : undefined}
|
|
359
|
+
>
|
|
348
360
|
<TransportInfo
|
|
349
361
|
content={entry}
|
|
350
362
|
value={value}
|
|
@@ -375,13 +387,13 @@ export default function DefaultLayout(props: LayoutProps) {
|
|
|
375
387
|
>
|
|
376
388
|
<PlayerImageBackground
|
|
377
389
|
entry={entry}
|
|
378
|
-
docked={docked}
|
|
379
390
|
style={Styles.backgroundImageContainer(dimensions, isTablet)}
|
|
380
391
|
imageStyle={Styles.backgroundImageContainerImageStyle(
|
|
381
392
|
isTablet,
|
|
382
393
|
docked,
|
|
383
394
|
startComponentsAnimation,
|
|
384
|
-
isActiveGesture
|
|
395
|
+
isActiveGesture,
|
|
396
|
+
playerAnimationState
|
|
385
397
|
)}
|
|
386
398
|
defaultImageDimensions={defaultImageDimensions}
|
|
387
399
|
/>
|
|
@@ -230,7 +230,7 @@ export default function DockedLayout(props: LayoutProps) {
|
|
|
230
230
|
} = useModalAnimationContext();
|
|
231
231
|
|
|
232
232
|
const maximazeVideoModal = React.useCallback(
|
|
233
|
-
() => setPlayerAnimationState(PlayerAnimationStateEnum.
|
|
233
|
+
() => setPlayerAnimationState(PlayerAnimationStateEnum.maximize),
|
|
234
234
|
[]
|
|
235
235
|
);
|
|
236
236
|
|
|
@@ -47,7 +47,7 @@ const fetchPaletteAndDominantColor = async (imageUrl: string) => {
|
|
|
47
47
|
const dominant = await getDominantColor(imageUrl);
|
|
48
48
|
const dominantColor = `rgb(${dominant.r}, ${dominant.g}, ${dominant.b})`;
|
|
49
49
|
|
|
50
|
-
return { gradientColors: colors.slice(0, 2), dominantColor };
|
|
50
|
+
return { gradientColors: colors.slice(0, 2).reverse(), dominantColor };
|
|
51
51
|
};
|
|
52
52
|
|
|
53
53
|
export const MagicBG: React.FC<MagicBGProps> = ({
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { localStorage } from "@applicaster/zapp-react-native-bridge/ZappStorage/LocalStorage";
|
|
2
|
+
import {
|
|
3
|
+
PlayerAnimationStateEnum,
|
|
4
|
+
PlayerAnimationStateT,
|
|
5
|
+
} from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation/ModalAnimationContext";
|
|
2
6
|
import { parseJsonIfNeeded } from "@applicaster/zapp-react-native-utils/functionUtils";
|
|
3
7
|
|
|
4
8
|
export const NAMESPACE = "audio-player";
|
|
@@ -31,3 +35,23 @@ export const formatSpeed = (value: number) => {
|
|
|
31
35
|
// Return the formatted string with "speed_" prefix
|
|
32
36
|
return `speed_${formattedValue}`;
|
|
33
37
|
};
|
|
38
|
+
|
|
39
|
+
export const calculateBorderRadius = (
|
|
40
|
+
isTablet: boolean,
|
|
41
|
+
docked: boolean,
|
|
42
|
+
startComponentsAnimation: boolean,
|
|
43
|
+
isActiveGesture: boolean,
|
|
44
|
+
playerAnimationState: PlayerAnimationStateT
|
|
45
|
+
): number => {
|
|
46
|
+
const shouldRemoveBorderRadius =
|
|
47
|
+
(startComponentsAnimation &&
|
|
48
|
+
isActiveGesture &&
|
|
49
|
+
playerAnimationState !== PlayerAnimationStateEnum.maximize) ||
|
|
50
|
+
docked;
|
|
51
|
+
|
|
52
|
+
if (shouldRemoveBorderRadius) {
|
|
53
|
+
return 0;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
return isTablet ? 24 : 10;
|
|
57
|
+
};
|