@applicaster/quick-brick-player 12.0.12-rc.0 → 12.0.12-rc.2
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applicaster/quick-brick-player",
|
|
3
|
-
"version": "12.0.12-rc.
|
|
3
|
+
"version": "12.0.12-rc.2",
|
|
4
4
|
"description": "Quick Brick Player",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -38,9 +38,9 @@
|
|
|
38
38
|
"dependencies": {
|
|
39
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.12-rc.
|
|
42
|
-
"@applicaster/zapp-react-native-ui-components": "12.0.12-rc.
|
|
43
|
-
"@applicaster/zapp-react-native-utils": "12.0.12-rc.
|
|
41
|
+
"@applicaster/zapp-react-native-tvos-app": "12.0.12-rc.2",
|
|
42
|
+
"@applicaster/zapp-react-native-ui-components": "12.0.12-rc.2",
|
|
43
|
+
"@applicaster/zapp-react-native-utils": "12.0.12-rc.2",
|
|
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
|
};
|
|
@@ -127,9 +129,12 @@ const sleeps = [
|
|
|
127
129
|
{ label: "2 hours", value: 120 },
|
|
128
130
|
];
|
|
129
131
|
|
|
132
|
+
const edges: Edge[] = ["right", "left", "top"];
|
|
133
|
+
|
|
130
134
|
export const AudioPlayerWrapper: React.FC<Props> = (props: Props) => {
|
|
131
135
|
const player = usePlayer();
|
|
132
136
|
const playerState = usePlayerState("audio-player-wrapper");
|
|
137
|
+
const theme = useTheme();
|
|
133
138
|
|
|
134
139
|
const {
|
|
135
140
|
docked,
|
|
@@ -359,8 +364,6 @@ export const AudioPlayerWrapper: React.FC<Props> = (props: Props) => {
|
|
|
359
364
|
player?.seekTo(0);
|
|
360
365
|
}, [player]);
|
|
361
366
|
|
|
362
|
-
const edges = React.useMemo<Edge[]>(() => ["right", "left", "top"], [docked]);
|
|
363
|
-
|
|
364
367
|
const ContainerView = SafeAreaView;
|
|
365
368
|
|
|
366
369
|
const MainContent = React.useMemo(() => {
|
|
@@ -451,6 +454,10 @@ 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
463
|
const url =
|
|
@@ -461,7 +468,7 @@ export const AudioPlayerWrapper: React.FC<Props> = (props: Props) => {
|
|
|
461
468
|
image={url}
|
|
462
469
|
fallbackUrl={baseUrl}
|
|
463
470
|
colors={entry?.extensions?.backgroundColors}
|
|
464
|
-
defaultColor=
|
|
471
|
+
defaultColor={defaultBackgroundColor}
|
|
465
472
|
>
|
|
466
473
|
{MainContent}
|
|
467
474
|
</MagicBG>
|
|
@@ -38,6 +38,9 @@ import DockedLayout from "./DockedLayout";
|
|
|
38
38
|
import { isValidDate } from "../../Utils";
|
|
39
39
|
import { calculateBorderRadius } from "../utils";
|
|
40
40
|
|
|
41
|
+
const getAudioPlayerWidthForTablet = (isPortraitMode: boolean) =>
|
|
42
|
+
isPortraitMode ? 463 : 350;
|
|
43
|
+
|
|
41
44
|
type Dimensions = {
|
|
42
45
|
width: number;
|
|
43
46
|
height: number;
|
|
@@ -81,7 +84,8 @@ type LayoutProps = {
|
|
|
81
84
|
defaultDimensions: Dimensions;
|
|
82
85
|
};
|
|
83
86
|
|
|
84
|
-
const { width: SCREEN_WIDTH } =
|
|
87
|
+
const { width: SCREEN_WIDTH, height: SCREEN_HEIGHT } =
|
|
88
|
+
ScreenDimensions.get("screen");
|
|
85
89
|
|
|
86
90
|
const Styles = {
|
|
87
91
|
container: { flex: 1 },
|
|
@@ -90,33 +94,47 @@ const Styles = {
|
|
|
90
94
|
alignItems: "center",
|
|
91
95
|
justifyContent: isPortraitMode ? "center" : "flex-start",
|
|
92
96
|
}),
|
|
93
|
-
playerImageWrapper: {
|
|
97
|
+
playerImageWrapper: (docked: boolean) => ({
|
|
94
98
|
width: "100%",
|
|
95
99
|
maxHeight: 750,
|
|
96
|
-
marginTop: 80,
|
|
97
|
-
},
|
|
100
|
+
marginTop: docked ? 80 : 20,
|
|
101
|
+
}),
|
|
98
102
|
playerInfoWrapper: {
|
|
99
103
|
flex: 1,
|
|
100
104
|
alignItems: "center",
|
|
101
105
|
justifyContent: "space-between",
|
|
102
106
|
},
|
|
103
|
-
tabletLayout: {
|
|
104
|
-
width:
|
|
107
|
+
tabletLayout: (isPortraitMode: boolean) => ({
|
|
108
|
+
width: getAudioPlayerWidthForTablet(isPortraitMode),
|
|
105
109
|
marginBottom: 80,
|
|
106
|
-
|
|
110
|
+
paddingHorizontal: undefined, // override paddingHorizontal
|
|
111
|
+
}),
|
|
107
112
|
controls: (isTablet: boolean, isLiveShowFullControls: boolean) => ({
|
|
108
113
|
height: isTablet ? 64 : 50,
|
|
109
|
-
marginHorizontal: 10,
|
|
114
|
+
marginHorizontal: isTablet ? undefined : 10,
|
|
110
115
|
justifyContent: isLiveShowFullControls ? "space-between" : "space-evenly",
|
|
111
116
|
}),
|
|
112
|
-
backgroundImageContainer: (
|
|
117
|
+
backgroundImageContainer: (
|
|
118
|
+
dimensions: Dimensions,
|
|
119
|
+
isTablet: boolean,
|
|
120
|
+
isPortraitMode: boolean
|
|
121
|
+
) => {
|
|
122
|
+
if (isTablet) {
|
|
123
|
+
const size = getAudioPlayerWidthForTablet(isPortraitMode);
|
|
124
|
+
|
|
125
|
+
return {
|
|
126
|
+
width: size,
|
|
127
|
+
height: size,
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
|
|
113
131
|
const mobileValue = dimensions?.width
|
|
114
132
|
? dimensions.width - PADDING_HORIZONTAL * 2
|
|
115
133
|
: SCREEN_WIDTH - PADDING_HORIZONTAL * 2;
|
|
116
134
|
|
|
117
135
|
return {
|
|
118
|
-
width:
|
|
119
|
-
height:
|
|
136
|
+
width: mobileValue,
|
|
137
|
+
height: mobileValue,
|
|
120
138
|
};
|
|
121
139
|
},
|
|
122
140
|
backgroundImageContainerImageStyle: (
|
|
@@ -184,8 +202,7 @@ export default function DefaultLayout(props: LayoutProps) {
|
|
|
184
202
|
} = props;
|
|
185
203
|
|
|
186
204
|
const isTablet = useIsTablet();
|
|
187
|
-
const
|
|
188
|
-
const isPortraitMode = width < height;
|
|
205
|
+
const isPortraitMode = SCREEN_WIDTH < SCREEN_HEIGHT;
|
|
189
206
|
const isLiveContent = playerState.isLive;
|
|
190
207
|
const docked = layoutState.docked;
|
|
191
208
|
|
|
@@ -340,8 +357,13 @@ export default function DefaultLayout(props: LayoutProps) {
|
|
|
340
357
|
const Separator = () => <View style={Styles.separator} />;
|
|
341
358
|
|
|
342
359
|
const defaultImageDimensions = React.useMemo(
|
|
343
|
-
() =>
|
|
344
|
-
|
|
360
|
+
() =>
|
|
361
|
+
Styles.backgroundImageContainer(
|
|
362
|
+
defaultDimensions,
|
|
363
|
+
isTablet,
|
|
364
|
+
isPortraitMode
|
|
365
|
+
),
|
|
366
|
+
[defaultDimensions, isTablet, isPortraitMode]
|
|
345
367
|
);
|
|
346
368
|
|
|
347
369
|
const { isActiveGesture, startComponentsAnimation, playerAnimationState } =
|
|
@@ -368,13 +390,16 @@ export default function DefaultLayout(props: LayoutProps) {
|
|
|
368
390
|
</AnimationComponent>
|
|
369
391
|
<AnimationComponent
|
|
370
392
|
animationType={ComponentAnimationType.moveUpComponent}
|
|
371
|
-
style={isTablet ? Styles.playerImageWrapper : undefined}
|
|
393
|
+
style={isTablet ? Styles.playerImageWrapper(docked) : undefined}
|
|
372
394
|
>
|
|
373
395
|
<AnimationComponent
|
|
374
396
|
animationType={ComponentAnimationType.moveComponentHorizontal}
|
|
375
397
|
additionalData={{
|
|
376
398
|
disableAnimatedComponent: !isTablet,
|
|
377
|
-
moveValue:
|
|
399
|
+
moveValue:
|
|
400
|
+
(dimensions.width -
|
|
401
|
+
getAudioPlayerWidthForTablet(isPortraitMode)) /
|
|
402
|
+
2,
|
|
378
403
|
extraAnimation: !isTablet
|
|
379
404
|
? {
|
|
380
405
|
[ComponentAnimationType.audioPlayerPaddingHorizontal]: {
|
|
@@ -387,7 +412,11 @@ export default function DefaultLayout(props: LayoutProps) {
|
|
|
387
412
|
>
|
|
388
413
|
<PlayerImageBackground
|
|
389
414
|
entry={entry}
|
|
390
|
-
style={Styles.backgroundImageContainer(
|
|
415
|
+
style={Styles.backgroundImageContainer(
|
|
416
|
+
dimensions,
|
|
417
|
+
isTablet,
|
|
418
|
+
isPortraitMode
|
|
419
|
+
)}
|
|
391
420
|
imageStyle={Styles.backgroundImageContainerImageStyle(
|
|
392
421
|
isTablet,
|
|
393
422
|
docked,
|
|
@@ -404,7 +433,7 @@ export default function DefaultLayout(props: LayoutProps) {
|
|
|
404
433
|
<View
|
|
405
434
|
style={[
|
|
406
435
|
Styles.paddingHorizontal,
|
|
407
|
-
isTablet ? Styles.tabletLayout : undefined,
|
|
436
|
+
isTablet ? Styles.tabletLayout(isPortraitMode) : undefined,
|
|
408
437
|
]}
|
|
409
438
|
>
|
|
410
439
|
{!docked && (
|
|
@@ -17,7 +17,7 @@ const playbackButtonMargins = (
|
|
|
17
17
|
isTablet: boolean,
|
|
18
18
|
isLiveShowFullControls: boolean
|
|
19
19
|
): number =>
|
|
20
|
-
isLiveShowFullControls ? (isTablet ? 65 : 10) : isTablet ?
|
|
20
|
+
isLiveShowFullControls ? (isTablet ? 65 : 10) : isTablet ? undefined : 40;
|
|
21
21
|
|
|
22
22
|
export const PADDING_HORIZONTAL = 15;
|
|
23
23
|
|
package/src/Player/index.tsx
CHANGED
|
@@ -722,7 +722,7 @@ export default class VideoPlayer extends React.Component<
|
|
|
722
722
|
|
|
723
723
|
const isAudioItem =
|
|
724
724
|
entry?.content?.type?.includes?.("audio") ||
|
|
725
|
-
entry?.type?.value
|
|
725
|
+
entry?.type?.value?.includes?.("audio");
|
|
726
726
|
|
|
727
727
|
const getStyle = (dimensions) => {
|
|
728
728
|
const generalStyles = isAudioItem ? styles.audio : styles.video;
|