@applicaster/quick-brick-player 12.0.11 → 12.0.12-rc.0
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 +2 -1
- 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": "12.0.
|
|
3
|
+
"version": "12.0.12-rc.0",
|
|
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": "12.0.
|
|
39
|
+
"@applicaster/quick-brick-mobile-transport-controls": "12.0.12-rc.0",
|
|
40
40
|
"@applicaster/quick-brick-tv-transport-controls": "12.0.4",
|
|
41
|
-
"@applicaster/zapp-react-native-tvos-app": "12.0.
|
|
42
|
-
"@applicaster/zapp-react-native-ui-components": "12.0.
|
|
43
|
-
"@applicaster/zapp-react-native-utils": "12.0.
|
|
41
|
+
"@applicaster/zapp-react-native-tvos-app": "12.0.12-rc.0",
|
|
42
|
+
"@applicaster/zapp-react-native-ui-components": "12.0.12-rc.0",
|
|
43
|
+
"@applicaster/zapp-react-native-utils": "12.0.12-rc.0",
|
|
44
44
|
"keymirror": "^0.1.1",
|
|
45
45
|
"query-string": "7.1.3",
|
|
46
46
|
"react-native-web-linear-gradient": "1.1.2",
|
|
@@ -453,7 +453,8 @@ export const AudioPlayerWrapper: React.FC<Props> = (props: Props) => {
|
|
|
453
453
|
|
|
454
454
|
const queryParamValue = 15;
|
|
455
455
|
|
|
456
|
-
const url =
|
|
456
|
+
const url =
|
|
457
|
+
baseUrl && addQueryParam(baseUrl, queryParamName, queryParamValue);
|
|
457
458
|
|
|
458
459
|
return (
|
|
459
460
|
<MagicBG
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import * as R from "ramda";
|
|
3
|
-
import { View } from "react-native";
|
|
3
|
+
import { View, Dimensions as ScreenDimensions } from "react-native";
|
|
4
4
|
import { dayjs } from "@applicaster/zapp-react-native-utils/dateUtils";
|
|
5
5
|
|
|
6
6
|
import {
|
|
@@ -33,8 +33,10 @@ import {
|
|
|
33
33
|
AnimationComponent,
|
|
34
34
|
ComponentAnimationType,
|
|
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
|
+
};
|