@applicaster/quick-brick-player 14.0.0-rc.61 → 14.0.0-rc.63
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 +4 -4
- package/src/Player/AudioLayer/Layout/DockedControls/index.tsx +76 -72
- package/src/Player/PlayerModal/VideoPlayerModal.tsx +11 -14
- package/src/Player/PlayerModal/hooks/index.ts +5 -2
- package/src/Player/PlayerModal/styles.ts +1 -0
- package/src/Player/index.tsx +19 -28
- package/src/QuickBrickPlayer.tsx +13 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applicaster/quick-brick-player",
|
|
3
|
-
"version": "14.0.0-rc.
|
|
3
|
+
"version": "14.0.0-rc.63",
|
|
4
4
|
"description": "Quick Brick Player",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -37,9 +37,9 @@
|
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@applicaster/quick-brick-mobile-transport-controls": "14.0.0-rc.56",
|
|
39
39
|
"@applicaster/quick-brick-tv-transport-controls": "14.0.0-rc.60",
|
|
40
|
-
"@applicaster/zapp-react-native-tvos-app": "14.0.0-rc.
|
|
41
|
-
"@applicaster/zapp-react-native-ui-components": "14.0.0-rc.
|
|
42
|
-
"@applicaster/zapp-react-native-utils": "14.0.0-rc.
|
|
40
|
+
"@applicaster/zapp-react-native-tvos-app": "14.0.0-rc.63",
|
|
41
|
+
"@applicaster/zapp-react-native-ui-components": "14.0.0-rc.63",
|
|
42
|
+
"@applicaster/zapp-react-native-utils": "14.0.0-rc.63",
|
|
43
43
|
"query-string": "7.1.3",
|
|
44
44
|
"shaka-player": "4.3.5",
|
|
45
45
|
"typeface-montserrat": "^0.0.54",
|
|
@@ -185,8 +185,10 @@ export const DockedControls = (props: Props) => {
|
|
|
185
185
|
const configuration = useZStore("playerConfiguration")();
|
|
186
186
|
const playerState = usePlayerState("shared-player-wrapper-docked");
|
|
187
187
|
|
|
188
|
-
const getValue = (
|
|
189
|
-
R.propOr(null, key, stylesObj)
|
|
188
|
+
const getValue = React.useCallback(
|
|
189
|
+
(key: string, stylesObj: {}) => R.propOr(null, key, stylesObj),
|
|
190
|
+
[]
|
|
191
|
+
);
|
|
190
192
|
|
|
191
193
|
const value = React.useCallback(
|
|
192
194
|
(key: string) => {
|
|
@@ -206,7 +208,7 @@ export const DockedControls = (props: Props) => {
|
|
|
206
208
|
|
|
207
209
|
return retVal;
|
|
208
210
|
},
|
|
209
|
-
[...Object.values(configuration), playerState]
|
|
211
|
+
[...Object.values(configuration), playerState.seekableDuration, getValue]
|
|
210
212
|
);
|
|
211
213
|
|
|
212
214
|
const { title, summary } = useTitleSummaryOverlay(
|
|
@@ -224,85 +226,87 @@ export const DockedControls = (props: Props) => {
|
|
|
224
226
|
const insets = useSafeAreaInsets();
|
|
225
227
|
|
|
226
228
|
return (
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
minimisedHeight
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
) : null}
|
|
229
|
+
<>
|
|
230
|
+
<View
|
|
231
|
+
style={[
|
|
232
|
+
styles.container,
|
|
233
|
+
{
|
|
234
|
+
height: minimisedHeight,
|
|
235
|
+
maxHeight: minimisedHeight,
|
|
236
|
+
},
|
|
237
|
+
]}
|
|
238
|
+
>
|
|
239
|
+
{!playerState.isLive ? (
|
|
240
|
+
<ProgressBar
|
|
241
|
+
name={"shared-docked-layout"}
|
|
242
|
+
content={entry}
|
|
243
|
+
value={value}
|
|
244
|
+
visible
|
|
245
|
+
layoutState={layoutState}
|
|
246
|
+
onPlayerSeek={onPlayerSeek}
|
|
247
|
+
playerState={playerState}
|
|
248
|
+
startComponentsAnimation={noop}
|
|
249
|
+
docked
|
|
250
|
+
/>
|
|
251
|
+
) : null}
|
|
251
252
|
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
253
|
+
<View style={styles.content}>
|
|
254
|
+
<View style={styles.touchableArea}>
|
|
255
|
+
{isActiveGesture || layoutState.docked ? (
|
|
256
|
+
<View
|
|
257
|
+
style={{ aspectRatio: aspectRatio, height: minimisedHeight }}
|
|
258
|
+
>
|
|
259
|
+
{ImageComponent || null}
|
|
260
|
+
</View>
|
|
261
|
+
) : (
|
|
262
|
+
<View
|
|
263
|
+
style={playerDimensionsStyle(
|
|
264
|
+
minimisedHeight,
|
|
265
|
+
isActiveGesture || layoutState.docked
|
|
266
|
+
)}
|
|
267
|
+
/>
|
|
268
|
+
)}
|
|
259
269
|
<View
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
270
|
+
testID="content-info"
|
|
271
|
+
style={[
|
|
272
|
+
styles.contentInfo,
|
|
273
|
+
{ backgroundColor: dockedBackgroundColor },
|
|
274
|
+
]}
|
|
275
|
+
>
|
|
276
|
+
<ContentInfo
|
|
277
|
+
content={{ ...entry, title, summary }}
|
|
278
|
+
value={value}
|
|
279
|
+
docked
|
|
280
|
+
/>
|
|
281
|
+
</View>
|
|
282
|
+
</View>
|
|
266
283
|
<View
|
|
267
|
-
testID="content-info"
|
|
268
284
|
style={[
|
|
269
|
-
|
|
285
|
+
isTablet
|
|
286
|
+
? styles.controlsContainerForTablet
|
|
287
|
+
: styles.controlsContainerForMobile,
|
|
270
288
|
{ backgroundColor: dockedBackgroundColor },
|
|
271
289
|
]}
|
|
272
290
|
>
|
|
273
|
-
<
|
|
274
|
-
content={{ ...entry, title, summary }}
|
|
291
|
+
<Controls
|
|
275
292
|
value={value}
|
|
276
|
-
|
|
293
|
+
visible
|
|
294
|
+
buttons={R.partial(controlButtons, [
|
|
295
|
+
playerState.isLive && liveButton,
|
|
296
|
+
])}
|
|
297
|
+
style={styles.playPauseButton}
|
|
298
|
+
playNextData={playNextData}
|
|
299
|
+
playerState={playerState}
|
|
300
|
+
/>
|
|
301
|
+
<Button
|
|
302
|
+
icon={"close_mini"}
|
|
303
|
+
size={"medium"}
|
|
304
|
+
value={value}
|
|
305
|
+
onPress={onCloseVideoModal}
|
|
306
|
+
style={styles.buttons}
|
|
277
307
|
/>
|
|
278
308
|
</View>
|
|
279
309
|
</View>
|
|
280
|
-
<View
|
|
281
|
-
style={[
|
|
282
|
-
isTablet
|
|
283
|
-
? styles.controlsContainerForTablet
|
|
284
|
-
: styles.controlsContainerForMobile,
|
|
285
|
-
{ backgroundColor: dockedBackgroundColor },
|
|
286
|
-
]}
|
|
287
|
-
>
|
|
288
|
-
<Controls
|
|
289
|
-
value={value}
|
|
290
|
-
visible
|
|
291
|
-
buttons={R.partial(controlButtons, [
|
|
292
|
-
playerState.isLive && liveButton,
|
|
293
|
-
])}
|
|
294
|
-
style={styles.playPauseButton}
|
|
295
|
-
playNextData={playNextData}
|
|
296
|
-
playerState={playerState}
|
|
297
|
-
/>
|
|
298
|
-
<Button
|
|
299
|
-
icon={"close_mini"}
|
|
300
|
-
size={"medium"}
|
|
301
|
-
value={value}
|
|
302
|
-
onPress={onCloseVideoModal}
|
|
303
|
-
style={styles.buttons}
|
|
304
|
-
/>
|
|
305
|
-
</View>
|
|
306
310
|
</View>
|
|
307
311
|
<View
|
|
308
312
|
style={{
|
|
@@ -310,6 +314,6 @@ export const DockedControls = (props: Props) => {
|
|
|
310
314
|
backgroundColor: dockedBackgroundColor,
|
|
311
315
|
}}
|
|
312
316
|
/>
|
|
313
|
-
|
|
317
|
+
</>
|
|
314
318
|
);
|
|
315
319
|
};
|
|
@@ -30,18 +30,12 @@ const directionStyles = (isLandscape: boolean): ViewStyle => {
|
|
|
30
30
|
};
|
|
31
31
|
|
|
32
32
|
type AnimatedModalProps = {
|
|
33
|
-
enabled?: boolean;
|
|
34
33
|
pip?: boolean;
|
|
35
34
|
fullscreen?: boolean;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
opacity: Animated.Value | Animated.AnimatedInterpolation<number>
|
|
41
|
-
) => ReactElement;
|
|
42
|
-
extraContent?: (
|
|
43
|
-
opacity: Animated.Value | Animated.AnimatedInterpolation<number>
|
|
44
|
-
) => ReactElement;
|
|
35
|
+
modal?: boolean;
|
|
36
|
+
content?: ReactElement;
|
|
37
|
+
collapsedContent?: ReactElement;
|
|
38
|
+
extraContent?: ReactElement;
|
|
45
39
|
aspectRatio?: number;
|
|
46
40
|
isTabletPortrait?: boolean;
|
|
47
41
|
style?: {
|
|
@@ -54,7 +48,6 @@ type AnimatedModalProps = {
|
|
|
54
48
|
const height = SCREEN_HEIGHT;
|
|
55
49
|
|
|
56
50
|
export function VideoPlayerModal({
|
|
57
|
-
enabled = true,
|
|
58
51
|
aspectRatio = DEFAULT_IMAGE_RATIO_VIDEO,
|
|
59
52
|
content,
|
|
60
53
|
extraContent,
|
|
@@ -63,7 +56,9 @@ export function VideoPlayerModal({
|
|
|
63
56
|
style,
|
|
64
57
|
pip = false,
|
|
65
58
|
fullscreen = false,
|
|
59
|
+
modal = true,
|
|
66
60
|
}: AnimatedModalProps) {
|
|
61
|
+
const enabled = !!modal && !fullscreen;
|
|
67
62
|
const isTablet = useIsTablet();
|
|
68
63
|
|
|
69
64
|
let width = SCREEN_WIDTH;
|
|
@@ -76,6 +71,8 @@ export function VideoPlayerModal({
|
|
|
76
71
|
const scrollViewRef = useRef<typeof Animated.ScrollView | null>(null);
|
|
77
72
|
|
|
78
73
|
const translateYRef = useModalAnimationContext().yTranslate;
|
|
74
|
+
// used when modal is false, should not be used in animation
|
|
75
|
+
const dummyRef = useRef(new Animated.Value(0));
|
|
79
76
|
|
|
80
77
|
const {
|
|
81
78
|
translateY,
|
|
@@ -83,7 +80,7 @@ export function VideoPlayerModal({
|
|
|
83
80
|
collapsedHeight,
|
|
84
81
|
gestureHandlerProps,
|
|
85
82
|
expand,
|
|
86
|
-
} = useVideoModalState(translateYRef);
|
|
83
|
+
} = useVideoModalState(modal ? translateYRef : dummyRef);
|
|
87
84
|
|
|
88
85
|
const isTabletLandscape = !isTV() && isTablet && !isTabletPortrait;
|
|
89
86
|
|
|
@@ -212,7 +209,7 @@ export function VideoPlayerModal({
|
|
|
212
209
|
},
|
|
213
210
|
]}
|
|
214
211
|
>
|
|
215
|
-
{content
|
|
212
|
+
{content}
|
|
216
213
|
</Animated.View>
|
|
217
214
|
{extraContent ? (
|
|
218
215
|
<GestureAnimatedScrollView
|
|
@@ -225,7 +222,7 @@ export function VideoPlayerModal({
|
|
|
225
222
|
{ opacity: expandedOpacity },
|
|
226
223
|
]}
|
|
227
224
|
>
|
|
228
|
-
{extraContent
|
|
225
|
+
{extraContent || null}
|
|
229
226
|
</GestureAnimatedScrollView>
|
|
230
227
|
) : null}
|
|
231
228
|
</Animated.View>
|
|
@@ -33,15 +33,18 @@ export const useVideoModalState = (
|
|
|
33
33
|
} = useNavigation();
|
|
34
34
|
|
|
35
35
|
const plugins = usePlugins();
|
|
36
|
+
|
|
36
37
|
const menuVisible = isMenuVisible(currentRoute, screenData, plugins);
|
|
37
38
|
|
|
38
39
|
const collapsed = videoModalState.mode === VideoModalMode.MINIMIZED;
|
|
39
40
|
|
|
40
41
|
const { bottom } = useSafeAreaInsets();
|
|
41
42
|
|
|
43
|
+
const initialBottomOffset = useRef(bottom).current;
|
|
44
|
+
|
|
42
45
|
const collapsedHeight =
|
|
43
46
|
minimisedHeight +
|
|
44
|
-
|
|
47
|
+
initialBottomOffset +
|
|
45
48
|
(menuVisible ? bottomTabBarHeight : 0) +
|
|
46
49
|
PROGRESS_BAR_HEIGHT;
|
|
47
50
|
|
|
@@ -144,7 +147,7 @@ export const useVideoModalState = (
|
|
|
144
147
|
});
|
|
145
148
|
}
|
|
146
149
|
},
|
|
147
|
-
[collapsedHeight, translateY]
|
|
150
|
+
[collapsedHeight, translateY, collapsed, videoModalState]
|
|
148
151
|
);
|
|
149
152
|
|
|
150
153
|
const gestureHandlerProps = useMemo(() => {
|
package/src/Player/index.tsx
CHANGED
|
@@ -793,7 +793,7 @@ export default class VideoPlayer extends React.Component<
|
|
|
793
793
|
};
|
|
794
794
|
|
|
795
795
|
const isFullScreenAudioPlayer =
|
|
796
|
-
this.getPluginConfiguration()?.
|
|
796
|
+
this.getPluginConfiguration()?.full_screen_audio_player || false;
|
|
797
797
|
|
|
798
798
|
const isAudioPlayer = isFullScreenAudioPlayer && isAudioItem;
|
|
799
799
|
|
|
@@ -835,7 +835,7 @@ export default class VideoPlayer extends React.Component<
|
|
|
835
835
|
this.isReactNativeMethodsSupported() &&
|
|
836
836
|
RNPlayerManager?.[this.playerPluginId]?.play
|
|
837
837
|
) {
|
|
838
|
-
delete nativeProps
|
|
838
|
+
delete nativeProps.paused;
|
|
839
839
|
}
|
|
840
840
|
|
|
841
841
|
const adEvents = {
|
|
@@ -1032,11 +1032,11 @@ export default class VideoPlayer extends React.Component<
|
|
|
1032
1032
|
/>
|
|
1033
1033
|
) : (
|
|
1034
1034
|
<VideoPlayerModal
|
|
1035
|
-
enabled={!!isModal && !fullscreen}
|
|
1036
1035
|
isTabletPortrait={isTabletPortrait}
|
|
1037
1036
|
aspectRatio={aspectRatio}
|
|
1038
1037
|
pip={this.state.piped}
|
|
1039
1038
|
fullscreen={fullscreen}
|
|
1039
|
+
modal={isModal}
|
|
1040
1040
|
style={{
|
|
1041
1041
|
tabletLandscapeWidth: getTabletWidth(
|
|
1042
1042
|
this.getPluginConfiguration().tablet_landscape_sidebar_width,
|
|
@@ -1045,9 +1045,10 @@ export default class VideoPlayer extends React.Component<
|
|
|
1045
1045
|
width: style.width,
|
|
1046
1046
|
height: style.height,
|
|
1047
1047
|
}}
|
|
1048
|
-
content={
|
|
1048
|
+
content={
|
|
1049
1049
|
<PlayerWrapper
|
|
1050
1050
|
{...sharedWrapperViewProps}
|
|
1051
|
+
// eslint-disable-next-line react/no-unstable-nested-components
|
|
1051
1052
|
playerContent={(playerDimensions) => {
|
|
1052
1053
|
const shouldRenderBackground =
|
|
1053
1054
|
!R.isNil(backgroundImageKey) &&
|
|
@@ -1060,11 +1061,7 @@ export default class VideoPlayer extends React.Component<
|
|
|
1060
1061
|
<View style={[playerContainerStyles, playerDimensions]}>
|
|
1061
1062
|
{isAudioItem ? (
|
|
1062
1063
|
<AudioPlayer
|
|
1063
|
-
style={
|
|
1064
|
-
isTV()
|
|
1065
|
-
? getStyle(playerDimensions)
|
|
1066
|
-
: styles.playerSize
|
|
1067
|
-
}
|
|
1064
|
+
style={styles.playerSize}
|
|
1068
1065
|
audio_item={entry}
|
|
1069
1066
|
plugin_configuration={this.getPluginConfiguration()}
|
|
1070
1067
|
/>
|
|
@@ -1086,11 +1083,7 @@ export default class VideoPlayer extends React.Component<
|
|
|
1086
1083
|
{...nativeEvents}
|
|
1087
1084
|
{...nativeProps}
|
|
1088
1085
|
listener={this.props.listener}
|
|
1089
|
-
style={
|
|
1090
|
-
isTV()
|
|
1091
|
-
? getStyle(playerDimensions)
|
|
1092
|
-
: styles.playerSize
|
|
1093
|
-
}
|
|
1086
|
+
style={styles.playerSize}
|
|
1094
1087
|
pluginConfiguration={this.getPluginConfiguration()}
|
|
1095
1088
|
controller={this.props.controller}
|
|
1096
1089
|
>
|
|
@@ -1117,8 +1110,8 @@ export default class VideoPlayer extends React.Component<
|
|
|
1117
1110
|
);
|
|
1118
1111
|
}}
|
|
1119
1112
|
/>
|
|
1120
|
-
|
|
1121
|
-
extraContent={
|
|
1113
|
+
}
|
|
1114
|
+
extraContent={
|
|
1122
1115
|
<PlayerDetails
|
|
1123
1116
|
configuration={this.getPluginConfiguration()}
|
|
1124
1117
|
style={{ flex: 1 }}
|
|
@@ -1129,18 +1122,16 @@ export default class VideoPlayer extends React.Component<
|
|
|
1129
1122
|
isModal={isModal}
|
|
1130
1123
|
pip={this.state.piped}
|
|
1131
1124
|
/>
|
|
1132
|
-
|
|
1133
|
-
collapsedContent={
|
|
1134
|
-
|
|
1135
|
-
<
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
</View>
|
|
1143
|
-
)
|
|
1125
|
+
}
|
|
1126
|
+
collapsedContent={
|
|
1127
|
+
<View style={styles.container}>
|
|
1128
|
+
<DockedControls
|
|
1129
|
+
entry={entry}
|
|
1130
|
+
aspectRatio={aspectRatio}
|
|
1131
|
+
layoutState={sharedWrapperViewProps.layoutState}
|
|
1132
|
+
playNextData={sharedWrapperViewProps.playNextData}
|
|
1133
|
+
/>
|
|
1134
|
+
</View>
|
|
1144
1135
|
}
|
|
1145
1136
|
/>
|
|
1146
1137
|
);
|
package/src/QuickBrickPlayer.tsx
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import { ZStoreProvider } from "@applicaster/zapp-react-native-utils/reactHooks/state";
|
|
2
3
|
|
|
3
4
|
import { useOrientationEffect } from "@applicaster/zapp-react-native-utils/reactHooks/videoModal";
|
|
4
5
|
import Player from "./Player";
|
|
@@ -49,16 +50,18 @@ const QuickBrickPlayerComponent = (
|
|
|
49
50
|
usePlayerTTS();
|
|
50
51
|
|
|
51
52
|
return (
|
|
52
|
-
<
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
53
|
+
<ZStoreProvider name="playerConfiguration" value={controller?.config}>
|
|
54
|
+
<Player
|
|
55
|
+
{...props}
|
|
56
|
+
ref={ref}
|
|
57
|
+
castAction={!props?.disableCastAction && castAction}
|
|
58
|
+
isCasting={isCasting}
|
|
59
|
+
PlayerComponent={props.PlayerComponent}
|
|
60
|
+
openPiP={openPiP}
|
|
61
|
+
closePiP={closePiP}
|
|
62
|
+
mode={mode}
|
|
63
|
+
/>
|
|
64
|
+
</ZStoreProvider>
|
|
62
65
|
);
|
|
63
66
|
};
|
|
64
67
|
|