@applicaster/quick-brick-player 12.0.0-alpha.5040434238 → 12.0.0-alpha.5061452310
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 +6 -10
- package/src/Player/AudioLayer/Layout/DefaultLayout.tsx +69 -29
- package/src/Player/AudioLayer/Layout/DockedLayout.tsx +43 -10
- package/src/Player/AudioLayer/MagicBG/index.tsx +1 -1
- package/src/Player/index.tsx +28 -23
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applicaster/quick-brick-player",
|
|
3
|
-
"version": "12.0.0-alpha.
|
|
3
|
+
"version": "12.0.0-alpha.5061452310",
|
|
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.0-
|
|
39
|
+
"@applicaster/quick-brick-mobile-transport-controls": "12.0.0-rc.49",
|
|
40
40
|
"@applicaster/quick-brick-tv-transport-controls": "11.0.0-rc.133",
|
|
41
|
-
"@applicaster/zapp-react-native-tvos-app": "12.0.0-alpha.
|
|
42
|
-
"@applicaster/zapp-react-native-ui-components": "12.0.0-alpha.
|
|
43
|
-
"@applicaster/zapp-react-native-utils": "12.0.0-alpha.
|
|
41
|
+
"@applicaster/zapp-react-native-tvos-app": "12.0.0-alpha.5061452310",
|
|
42
|
+
"@applicaster/zapp-react-native-ui-components": "12.0.0-alpha.5061452310",
|
|
43
|
+
"@applicaster/zapp-react-native-utils": "12.0.0-alpha.5061452310",
|
|
44
44
|
"keymirror": "^0.1.1",
|
|
45
45
|
"query-string": "7.1.3",
|
|
46
46
|
"react-native-web-linear-gradient": "1.1.2",
|
|
@@ -54,7 +54,7 @@ type Configuration = {
|
|
|
54
54
|
};
|
|
55
55
|
|
|
56
56
|
type Props = {
|
|
57
|
-
children
|
|
57
|
+
children?: React.ReactNode;
|
|
58
58
|
inline?: boolean;
|
|
59
59
|
docked?: boolean;
|
|
60
60
|
configuration: Configuration;
|
|
@@ -377,10 +377,7 @@ export const AudioPlayerWrapper: React.FC<Props> = (props: Props) => {
|
|
|
377
377
|
player?.seekTo(0);
|
|
378
378
|
}, [player]);
|
|
379
379
|
|
|
380
|
-
const edges = React.useMemo<Edge[]>(
|
|
381
|
-
() => (["right", "left", "top"]),
|
|
382
|
-
[docked]
|
|
383
|
-
);
|
|
380
|
+
const edges = React.useMemo<Edge[]>(() => ["right", "left", "top"], [docked]);
|
|
384
381
|
|
|
385
382
|
const ContainerView = SafeAreaView;
|
|
386
383
|
|
|
@@ -392,10 +389,7 @@ export const AudioPlayerWrapper: React.FC<Props> = (props: Props) => {
|
|
|
392
389
|
additionalData={{ saveArea: true }}
|
|
393
390
|
>
|
|
394
391
|
<AnimatedScrollModal>
|
|
395
|
-
<View
|
|
396
|
-
style={Styles.playerContainer}
|
|
397
|
-
onLayout={onLayout}
|
|
398
|
-
>
|
|
392
|
+
<View style={Styles.playerContainer} onLayout={onLayout}>
|
|
399
393
|
<Layout
|
|
400
394
|
entry={entry}
|
|
401
395
|
playerState={playerState}
|
|
@@ -426,7 +420,9 @@ export const AudioPlayerWrapper: React.FC<Props> = (props: Props) => {
|
|
|
426
420
|
/>
|
|
427
421
|
<View style={Styles.paddingHorizontal}>
|
|
428
422
|
{children}
|
|
429
|
-
<AnimationComponent
|
|
423
|
+
<AnimationComponent
|
|
424
|
+
animationType={ComponentAnimationType.componentFade}
|
|
425
|
+
>
|
|
430
426
|
<PlayerDetails
|
|
431
427
|
configuration={configuration}
|
|
432
428
|
style={Styles.playerDetails}
|
|
@@ -27,7 +27,11 @@ import { PlayerImageBackground } from "@applicaster/zapp-react-native-ui-compone
|
|
|
27
27
|
import { useLanguageData } from "@applicaster/zapp-react-native-utils/reactHooks/player";
|
|
28
28
|
import { PlayNextData } from "@applicaster/zapp-react-native-ui-components/Components/PlayerContainer/PlayerContainer";
|
|
29
29
|
import { useEffect, useMemo, useState } from "react";
|
|
30
|
-
import {
|
|
30
|
+
import {
|
|
31
|
+
useModalAnimationContext,
|
|
32
|
+
AnimationComponent,
|
|
33
|
+
ComponentAnimationType,
|
|
34
|
+
} from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation";
|
|
31
35
|
import DockedLayout from "./DockedLayout";
|
|
32
36
|
|
|
33
37
|
type Dimensions = {
|
|
@@ -95,19 +99,31 @@ const Styles = {
|
|
|
95
99
|
justifyContent: isLiveShowFullControls ? "space-between" : "space-evenly",
|
|
96
100
|
}),
|
|
97
101
|
backgroundImageContainer: (dimensions: Dimensions, isTablet: boolean) => {
|
|
98
|
-
const mobileValue = dimensions.width
|
|
102
|
+
const mobileValue = dimensions.width
|
|
103
|
+
? dimensions.width - PADDING_HORIZONTAL * 2
|
|
104
|
+
: 330;
|
|
99
105
|
|
|
100
106
|
return {
|
|
101
107
|
width: isTablet ? 463 : mobileValue,
|
|
102
108
|
height: isTablet ? 463 : mobileValue,
|
|
103
109
|
};
|
|
104
110
|
},
|
|
105
|
-
backgroundImageContainerImageStyle: (
|
|
106
|
-
|
|
111
|
+
backgroundImageContainerImageStyle: (
|
|
112
|
+
isTablet,
|
|
113
|
+
docked,
|
|
114
|
+
startComponentsAnimation,
|
|
115
|
+
isActiveGesture
|
|
116
|
+
) => ({
|
|
117
|
+
borderRadius:
|
|
118
|
+
(startComponentsAnimation && isActiveGesture) || docked
|
|
119
|
+
? 0
|
|
120
|
+
: isTablet
|
|
121
|
+
? 24
|
|
122
|
+
: 10,
|
|
107
123
|
}),
|
|
108
124
|
|
|
109
125
|
paddingHorizontal: {
|
|
110
|
-
paddingHorizontal: PADDING_HORIZONTAL
|
|
126
|
+
paddingHorizontal: PADDING_HORIZONTAL,
|
|
111
127
|
},
|
|
112
128
|
|
|
113
129
|
controlsMobile: {
|
|
@@ -297,10 +313,15 @@ export default function DefaultLayout(props: LayoutProps) {
|
|
|
297
313
|
const needsToShowProgressBar =
|
|
298
314
|
(isLiveContent && liveSeekingEnabled) || !isLiveContent;
|
|
299
315
|
|
|
300
|
-
const defaultImageDimensions = React.useMemo(
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
316
|
+
const defaultImageDimensions = React.useMemo(
|
|
317
|
+
() =>
|
|
318
|
+
defaultDimensions &&
|
|
319
|
+
Styles.backgroundImageContainer(defaultDimensions, isTablet),
|
|
320
|
+
[defaultDimensions]
|
|
321
|
+
);
|
|
322
|
+
|
|
323
|
+
const { isActiveGesture, startComponentsAnimation } =
|
|
324
|
+
useModalAnimationContext();
|
|
304
325
|
|
|
305
326
|
return (
|
|
306
327
|
<View
|
|
@@ -318,34 +339,50 @@ export default function DefaultLayout(props: LayoutProps) {
|
|
|
318
339
|
actionButtons={actionButtons}
|
|
319
340
|
/>
|
|
320
341
|
</AnimationComponent>
|
|
321
|
-
<AnimationComponent
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
342
|
+
<AnimationComponent
|
|
343
|
+
animationType={ComponentAnimationType.moveUpComponent}
|
|
344
|
+
style={isTablet ? Styles.playerImageWrapper : null}
|
|
345
|
+
>
|
|
346
|
+
<AnimationComponent
|
|
347
|
+
animationType={ComponentAnimationType.moveComponentHorizontal}
|
|
348
|
+
additionalData={{
|
|
349
|
+
disableAnimatedComponent: !isTablet,
|
|
350
|
+
moveValue: (dimensions.width - 463) / 2,
|
|
351
|
+
extraAnimation: !isTablet
|
|
352
|
+
? {
|
|
353
|
+
[ComponentAnimationType.audioPlayerPaddingHorizontal]: {
|
|
354
|
+
style: Styles.paddingHorizontal,
|
|
355
|
+
},
|
|
331
356
|
}
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
}
|
|
335
|
-
|
|
357
|
+
: null,
|
|
358
|
+
}}
|
|
359
|
+
style={isTablet ? Styles.alignItemsCenter : null}
|
|
360
|
+
>
|
|
336
361
|
<PlayerImageBackground
|
|
337
362
|
entry={entry}
|
|
338
363
|
style={Styles.backgroundImageContainer(dimensions, isTablet)}
|
|
339
|
-
imageStyle={Styles.backgroundImageContainerImageStyle(
|
|
364
|
+
imageStyle={Styles.backgroundImageContainerImageStyle(
|
|
365
|
+
isTablet,
|
|
366
|
+
docked,
|
|
367
|
+
startComponentsAnimation,
|
|
368
|
+
isActiveGesture
|
|
369
|
+
)}
|
|
340
370
|
defaultImageDimensions={defaultImageDimensions}
|
|
341
371
|
/>
|
|
342
372
|
</AnimationComponent>
|
|
343
373
|
|
|
344
374
|
<DockedLayout {...props} />
|
|
345
375
|
</AnimationComponent>
|
|
346
|
-
<View
|
|
347
|
-
{
|
|
348
|
-
|
|
376
|
+
<View
|
|
377
|
+
style={[
|
|
378
|
+
Styles.paddingHorizontal,
|
|
379
|
+
isTablet ? Styles.tabletLayout : null,
|
|
380
|
+
]}
|
|
381
|
+
>
|
|
382
|
+
{!docked && (
|
|
383
|
+
<AnimationComponent
|
|
384
|
+
animationType={ComponentAnimationType.componentFade}
|
|
385
|
+
>
|
|
349
386
|
<AudioDescription
|
|
350
387
|
title={title}
|
|
351
388
|
summary={summary}
|
|
@@ -382,11 +419,14 @@ export default function DefaultLayout(props: LayoutProps) {
|
|
|
382
419
|
visible={true}
|
|
383
420
|
keepAlive={null}
|
|
384
421
|
buttons={controlButtons}
|
|
385
|
-
style={Styles.controls(
|
|
422
|
+
style={Styles.controls(
|
|
423
|
+
isTablet,
|
|
424
|
+
isLiveContent && showFullControls
|
|
425
|
+
)}
|
|
386
426
|
playerState={playerState}
|
|
387
427
|
/>
|
|
388
428
|
</AnimationComponent>
|
|
389
|
-
}
|
|
429
|
+
)}
|
|
390
430
|
</View>
|
|
391
431
|
</View>
|
|
392
432
|
);
|
|
@@ -109,8 +109,11 @@ const backgroundColorStyle = (value: GetValue): ViewStyle => ({
|
|
|
109
109
|
backgroundColor: value("docked_player_background_color"),
|
|
110
110
|
});
|
|
111
111
|
|
|
112
|
-
const playerDimensionsStyle = (
|
|
113
|
-
|
|
112
|
+
const playerDimensionsStyle = (
|
|
113
|
+
minimisedHeight: number,
|
|
114
|
+
addPadding: boolean
|
|
115
|
+
): ViewStyle => ({
|
|
116
|
+
paddingLeft: addPadding ? minimisedHeight || 100 : 0,
|
|
114
117
|
});
|
|
115
118
|
|
|
116
119
|
const animatedContainerStyle = (docked: boolean): ViewStyle => ({
|
|
@@ -120,7 +123,11 @@ const animatedContainerStyle = (docked: boolean): ViewStyle => ({
|
|
|
120
123
|
zIndex: docked ? 1 : -1,
|
|
121
124
|
});
|
|
122
125
|
|
|
123
|
-
const backgroundImageStyle = (
|
|
126
|
+
const backgroundImageStyle = (
|
|
127
|
+
dimensions: Dimensions,
|
|
128
|
+
minimisedHeight: number,
|
|
129
|
+
isActiveGesture: boolean
|
|
130
|
+
): ViewStyle => ({
|
|
124
131
|
height: isActiveGesture ? minimisedHeight : dimensions.height,
|
|
125
132
|
aspectRatio: 1,
|
|
126
133
|
position: "absolute",
|
|
@@ -215,14 +222,28 @@ export default function DockedLayout(props: LayoutProps) {
|
|
|
215
222
|
|
|
216
223
|
const visible = true;
|
|
217
224
|
const liveButton = Boolean(value("live_badge_enabled"));
|
|
218
|
-
|
|
219
|
-
const
|
|
225
|
+
|
|
226
|
+
const {
|
|
227
|
+
isActiveGesture,
|
|
228
|
+
setPlayerAnimationState,
|
|
229
|
+
startComponentsAnimation,
|
|
230
|
+
minimisedHeight,
|
|
231
|
+
} = useModalAnimationContext();
|
|
232
|
+
|
|
233
|
+
const maximazeVideoModal = React.useCallback(
|
|
234
|
+
() => setPlayerAnimationState(PlayerAnimationStateEnum.maximaze),
|
|
235
|
+
[]
|
|
236
|
+
);
|
|
220
237
|
|
|
221
238
|
if (!layoutState.docked && !startComponentsAnimation) return null;
|
|
222
|
-
|
|
239
|
+
|
|
223
240
|
return (
|
|
224
|
-
<AnimationComponent
|
|
225
|
-
|
|
241
|
+
<AnimationComponent
|
|
242
|
+
animationType={ComponentAnimationType.componentAppears}
|
|
243
|
+
style={[
|
|
244
|
+
styles.container,
|
|
245
|
+
animatedContainerStyle(isActiveGesture || layoutState.docked),
|
|
246
|
+
]}
|
|
226
247
|
>
|
|
227
248
|
{!playerState.isLive && layoutState.docked && (
|
|
228
249
|
<ProgressBar
|
|
@@ -237,10 +258,22 @@ export default function DockedLayout(props: LayoutProps) {
|
|
|
237
258
|
)}
|
|
238
259
|
|
|
239
260
|
<View style={styles.content}>
|
|
240
|
-
<View
|
|
261
|
+
<View
|
|
262
|
+
style={backgroundImageStyle(
|
|
263
|
+
dimensions,
|
|
264
|
+
minimisedHeight,
|
|
265
|
+
isActiveGesture
|
|
266
|
+
)}
|
|
267
|
+
/>
|
|
241
268
|
<TouchableWithoutFeedback onPress={maximazeVideoModal}>
|
|
242
269
|
<View
|
|
243
|
-
style={[
|
|
270
|
+
style={[
|
|
271
|
+
styles.touchableArea,
|
|
272
|
+
playerDimensionsStyle(
|
|
273
|
+
minimisedHeight,
|
|
274
|
+
isActiveGesture || layoutState.docked
|
|
275
|
+
),
|
|
276
|
+
]}
|
|
244
277
|
>
|
|
245
278
|
<View
|
|
246
279
|
style={[
|
package/src/Player/index.tsx
CHANGED
|
@@ -38,7 +38,10 @@ import { getAllAccessibilityProps } from "@applicaster/zapp-react-native-utils/c
|
|
|
38
38
|
import { PlayNextData } from "@applicaster/zapp-react-native-ui-components/Components/PlayerContainer/PlayerContainer";
|
|
39
39
|
import { getTargetScreenDataFromEntry } from "@applicaster/zapp-react-native-utils/reactHooks/screen/useTargetScreenData";
|
|
40
40
|
import { isAppleTV } from "@applicaster/zapp-react-native-ui-components/Helpers/Platform";
|
|
41
|
-
import {
|
|
41
|
+
import {
|
|
42
|
+
AnimationComponent,
|
|
43
|
+
ComponentAnimationType,
|
|
44
|
+
} from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation";
|
|
42
45
|
|
|
43
46
|
const RNPlayerManager = {
|
|
44
47
|
QuickBrickPlayerPlugin: isApplePlatform()
|
|
@@ -1070,22 +1073,7 @@ export default class VideoPlayer extends React.Component<
|
|
|
1070
1073
|
{...nativeProps}
|
|
1071
1074
|
/>
|
|
1072
1075
|
)}
|
|
1073
|
-
<AudioPlayerWrapper {...sharedWrapperViewProps}
|
|
1074
|
-
<View>
|
|
1075
|
-
{
|
|
1076
|
-
<PlayNextOverlay
|
|
1077
|
-
item={entry}
|
|
1078
|
-
playerIsDocked={docked}
|
|
1079
|
-
pluginConfiguration={this.getPluginConfiguration()}
|
|
1080
|
-
playerId={this.props.playerId}
|
|
1081
|
-
playNextData={this.getPlayNextData()}
|
|
1082
|
-
setNextVideoPreloadThresholdPercentage={
|
|
1083
|
-
this.props.setNextVideoPreloadThresholdPercentage
|
|
1084
|
-
}
|
|
1085
|
-
/>
|
|
1086
|
-
}
|
|
1087
|
-
</View>
|
|
1088
|
-
</AudioPlayerWrapper>
|
|
1076
|
+
<AudioPlayerWrapper {...sharedWrapperViewProps} />
|
|
1089
1077
|
</View>
|
|
1090
1078
|
) : (
|
|
1091
1079
|
<PlayerWrapper {...sharedWrapperViewProps}>
|
|
@@ -1100,11 +1088,24 @@ export default class VideoPlayer extends React.Component<
|
|
|
1100
1088
|
<View style={styles.container}>
|
|
1101
1089
|
<View style={[playerContainerStyles, playerDimensions]}>
|
|
1102
1090
|
{isAudioItem && (
|
|
1103
|
-
<
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1091
|
+
<AnimationComponent
|
|
1092
|
+
animationType={ComponentAnimationType.player}
|
|
1093
|
+
additionalData={{
|
|
1094
|
+
...playerDimensions,
|
|
1095
|
+
inlineAudioPlayer: true,
|
|
1096
|
+
}}
|
|
1097
|
+
style={getStyle(playerDimensions)}
|
|
1098
|
+
>
|
|
1099
|
+
<AudioPlayer
|
|
1100
|
+
style={
|
|
1101
|
+
isTV()
|
|
1102
|
+
? getStyle(playerDimensions)
|
|
1103
|
+
: styles.playerSize
|
|
1104
|
+
}
|
|
1105
|
+
audio_item={entry}
|
|
1106
|
+
plugin_configuration={this.getPluginConfiguration()}
|
|
1107
|
+
/>
|
|
1108
|
+
</AnimationComponent>
|
|
1108
1109
|
)}
|
|
1109
1110
|
|
|
1110
1111
|
{shouldRenderBackground && (
|
|
@@ -1127,7 +1128,11 @@ export default class VideoPlayer extends React.Component<
|
|
|
1127
1128
|
{...nativeEvents}
|
|
1128
1129
|
{...nativeProps}
|
|
1129
1130
|
listener={this.props.listener}
|
|
1130
|
-
style={
|
|
1131
|
+
style={
|
|
1132
|
+
isTV()
|
|
1133
|
+
? getStyle(playerDimensions)
|
|
1134
|
+
: styles.playerSize
|
|
1135
|
+
}
|
|
1131
1136
|
pluginConfiguration={this.getPluginConfiguration()}
|
|
1132
1137
|
controller={this.props.controller}
|
|
1133
1138
|
>
|