@applicaster/quick-brick-player 14.0.0-alpha.8419134002 → 14.0.0-alpha.9848043301
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 +6 -6
- package/src/Player/AudioLayer/AudioPlayerWrapper.tsx +25 -81
- package/src/Player/AudioLayer/Layout/DockedControls/index.tsx +85 -101
- package/src/Player/AudioLayer/Layout/MobileLayout.tsx +2 -17
- package/src/Player/AudioLayer/Layout/PlayerImage/AnimatedImage.tsx +8 -48
- package/src/Player/AudioLayer/Layout/PlayerImage/FlexImage.tsx +9 -5
- package/src/Player/AudioLayer/Layout/PlayerImage/index.tsx +21 -72
- package/src/Player/AudioLayer/Layout/TabletLandscapeLayout.tsx +0 -16
- package/src/Player/AudioLayer/Layout/TransportInfo/index.tsx +12 -12
- package/src/Player/AudioLayer/components/SleepTimerModalHeader/SleepTimerModalHeader.tsx +1 -1
- package/src/Player/PlayerModal/GestureAnimatedScrollView.ts +7 -0
- package/src/Player/PlayerModal/PlayerModal.tsx +111 -0
- package/src/Player/PlayerModal/VideoPlayerModal.tsx +240 -0
- package/src/Player/PlayerModal/consts/index.ts +20 -0
- package/src/Player/PlayerModal/hooks/index.ts +161 -0
- package/src/Player/PlayerModal/index.ts +3 -0
- package/src/Player/PlayerModal/styles.ts +100 -0
- package/src/Player/PlayerView/GenericTVPlayerView.tsx +2 -1
- package/src/Player/index.tsx +161 -104
- /package/src/Player/AudioLayer/Layout/{DebugComponent → Debug}/index.tsx +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applicaster/quick-brick-player",
|
|
3
|
-
"version": "14.0.0-alpha.
|
|
3
|
+
"version": "14.0.0-alpha.9848043301",
|
|
4
4
|
"description": "Quick Brick Player",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -35,11 +35,11 @@
|
|
|
35
35
|
},
|
|
36
36
|
"homepage": "https://github.com/applicaster/quickbrick#readme",
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@applicaster/quick-brick-mobile-transport-controls": "14.0.0-
|
|
39
|
-
"@applicaster/quick-brick-tv-transport-controls": "14.0.0-rc.
|
|
40
|
-
"@applicaster/zapp-react-native-tvos-app": "14.0.0-alpha.
|
|
41
|
-
"@applicaster/zapp-react-native-ui-components": "14.0.0-alpha.
|
|
42
|
-
"@applicaster/zapp-react-native-utils": "14.0.0-alpha.
|
|
38
|
+
"@applicaster/quick-brick-mobile-transport-controls": "14.0.0-alpha.9848043301",
|
|
39
|
+
"@applicaster/quick-brick-tv-transport-controls": "14.0.0-rc.7",
|
|
40
|
+
"@applicaster/zapp-react-native-tvos-app": "14.0.0-alpha.9848043301",
|
|
41
|
+
"@applicaster/zapp-react-native-ui-components": "14.0.0-alpha.9848043301",
|
|
42
|
+
"@applicaster/zapp-react-native-utils": "14.0.0-alpha.9848043301",
|
|
43
43
|
"query-string": "7.1.3",
|
|
44
44
|
"react-native-web-linear-gradient": "1.1.2",
|
|
45
45
|
"shaka-player": "4.3.5",
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { useEffect, useState } from "react";
|
|
3
|
-
import {
|
|
4
|
-
Dimensions as ScreenDimensions,
|
|
5
|
-
StyleSheet,
|
|
6
|
-
View,
|
|
7
|
-
ViewStyle,
|
|
8
|
-
} from "react-native";
|
|
3
|
+
import { StyleSheet, View, ViewStyle } from "react-native";
|
|
9
4
|
|
|
10
5
|
import { Edge, SafeAreaView } from "react-native-safe-area-context";
|
|
11
6
|
import { usePlayerState } from "@applicaster/zapp-react-native-utils/appUtils/playerManager/usePlayerState";
|
|
@@ -13,14 +8,9 @@ import { usePlayer } from "@applicaster/zapp-react-native-utils/appUtils/playerM
|
|
|
13
8
|
import * as R from "ramda";
|
|
14
9
|
import { playerManager } from "@applicaster/zapp-react-native-utils/appUtils";
|
|
15
10
|
import Layout from "./Layout";
|
|
16
|
-
import {
|
|
17
|
-
useIsTablet,
|
|
18
|
-
useNavigation,
|
|
19
|
-
} from "@applicaster/zapp-react-native-utils/reactHooks";
|
|
11
|
+
import { useNavigation } from "@applicaster/zapp-react-native-utils/reactHooks";
|
|
20
12
|
import { createLogger } from "@applicaster/zapp-react-native-utils/logger";
|
|
21
13
|
import { PlayNextData } from "@applicaster/zapp-react-native-ui-components/Components/PlayerContainer/PlayerContainer";
|
|
22
|
-
import { PlayerDetails } from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/PlayerDetails";
|
|
23
|
-
import { isTV } from "@applicaster/zapp-react-native-utils/reactUtils";
|
|
24
14
|
import { formatSpeed } from "./utils";
|
|
25
15
|
import {
|
|
26
16
|
getBottomSheetModalDefaultItemIcon,
|
|
@@ -30,12 +20,7 @@ import {
|
|
|
30
20
|
getBottomSheetModalSelectedItemIcon,
|
|
31
21
|
} from "../Utils";
|
|
32
22
|
import { useTitleSummaryOverlay } from "@applicaster/zapp-react-native-utils/appUtils/playerManager/usePlayerTitleSummaryOverlay";
|
|
33
|
-
|
|
34
|
-
AnimatedScrollModal,
|
|
35
|
-
AnimationComponent,
|
|
36
|
-
ComponentAnimationType,
|
|
37
|
-
} from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation";
|
|
38
|
-
import { PADDING_HORIZONTAL } from "./Layout/const";
|
|
23
|
+
|
|
39
24
|
import { toNumberWithDefault } from "@applicaster/zapp-react-native-utils/numberUtils";
|
|
40
25
|
|
|
41
26
|
import { DEFAULT_SPEED, PlaybackSpeed, SpeedController } from "./SpeedManager";
|
|
@@ -81,18 +66,10 @@ type Props = {
|
|
|
81
66
|
isTabletPortrait?: boolean;
|
|
82
67
|
};
|
|
83
68
|
|
|
84
|
-
const { width: SCREEN_WIDTH } = ScreenDimensions.get("screen");
|
|
85
|
-
|
|
86
69
|
const Styles = StyleSheet.create({
|
|
87
70
|
playerContainer: {
|
|
88
71
|
flex: 1,
|
|
89
72
|
},
|
|
90
|
-
paddingHorizontal: { paddingTop: 0, paddingHorizontal: PADDING_HORIZONTAL },
|
|
91
|
-
playerDetails: {
|
|
92
|
-
marginTop: 60,
|
|
93
|
-
alignSelf: "center",
|
|
94
|
-
width: SCREEN_WIDTH - PADDING_HORIZONTAL * 2,
|
|
95
|
-
},
|
|
96
73
|
});
|
|
97
74
|
|
|
98
75
|
const edges: Edge[] = ["right", "left", "top"];
|
|
@@ -107,16 +84,10 @@ export const AudioPlayerWrapper: React.FC<Props> = (props: Props) => {
|
|
|
107
84
|
configuration,
|
|
108
85
|
style,
|
|
109
86
|
entry,
|
|
110
|
-
children,
|
|
111
87
|
layoutState,
|
|
112
88
|
playNextData = null,
|
|
113
|
-
isTabletPortrait,
|
|
114
89
|
} = props;
|
|
115
90
|
|
|
116
|
-
const isTablet = useIsTablet();
|
|
117
|
-
|
|
118
|
-
const isTabletLandscape = !isTV() && isTablet && !isTabletPortrait;
|
|
119
|
-
|
|
120
91
|
const { title, summary } = useTitleSummaryOverlay(
|
|
121
92
|
entry,
|
|
122
93
|
playerState?.isLive,
|
|
@@ -264,10 +235,6 @@ export const AudioPlayerWrapper: React.FC<Props> = (props: Props) => {
|
|
|
264
235
|
});
|
|
265
236
|
}, [playbackSpeed, onSpeedSelect, configuration["playback_speed_title"]]);
|
|
266
237
|
|
|
267
|
-
const onCloseVideoModal = React.useCallback(() => {
|
|
268
|
-
playerManager.close();
|
|
269
|
-
}, [playerManager]);
|
|
270
|
-
|
|
271
238
|
const onPlayerSeek = React.useCallback(
|
|
272
239
|
(targetTime: number) => {
|
|
273
240
|
player?.seekTo(targetTime);
|
|
@@ -285,51 +252,28 @@ export const AudioPlayerWrapper: React.FC<Props> = (props: Props) => {
|
|
|
285
252
|
|
|
286
253
|
return (
|
|
287
254
|
<SafeAreaView style={[style, Styles.playerContainer]} edges={edges}>
|
|
288
|
-
<
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
configuration={configuration}
|
|
311
|
-
dimensions={dimensions}
|
|
312
|
-
playNextData={playNextData}
|
|
313
|
-
title={title}
|
|
314
|
-
summary={summary}
|
|
315
|
-
/>
|
|
316
|
-
<View style={Styles.paddingHorizontal}>
|
|
317
|
-
{children}
|
|
318
|
-
<AnimationComponent
|
|
319
|
-
animationType={ComponentAnimationType.componentFade}
|
|
320
|
-
>
|
|
321
|
-
<PlayerDetails
|
|
322
|
-
isAudioPlayer
|
|
323
|
-
configuration={configuration}
|
|
324
|
-
style={Styles.playerDetails}
|
|
325
|
-
entry={entry}
|
|
326
|
-
isTabletLandscape={isTabletLandscape}
|
|
327
|
-
/>
|
|
328
|
-
</AnimationComponent>
|
|
329
|
-
</View>
|
|
330
|
-
</View>
|
|
331
|
-
</AnimatedScrollModal>
|
|
332
|
-
</AnimationComponent>
|
|
255
|
+
<View style={Styles.playerContainer} onLayout={onLayout}>
|
|
256
|
+
<Layout
|
|
257
|
+
entry={entry}
|
|
258
|
+
playerState={playerState}
|
|
259
|
+
layoutState={layoutState}
|
|
260
|
+
value={value}
|
|
261
|
+
onPlaybackButtonPress={onPlaybackButtonPress}
|
|
262
|
+
onRewindButtonPress={onRewindButtonPress}
|
|
263
|
+
onForwardButtonPress={onForwardButtonPress}
|
|
264
|
+
onPlayerSeek={onPlayerSeek}
|
|
265
|
+
onSkipStart={onSkipStart}
|
|
266
|
+
onSpeedButtonPress={onSpeedButtonPress}
|
|
267
|
+
playbackSpeedName={formatSpeed(playbackSpeed.value)}
|
|
268
|
+
onSkipLive={onSkipLive}
|
|
269
|
+
maximiseVideoModal={maximiseVideoModal}
|
|
270
|
+
configuration={configuration}
|
|
271
|
+
dimensions={dimensions}
|
|
272
|
+
playNextData={playNextData}
|
|
273
|
+
title={title}
|
|
274
|
+
summary={summary}
|
|
275
|
+
/>
|
|
276
|
+
</View>
|
|
333
277
|
</SafeAreaView>
|
|
334
278
|
);
|
|
335
279
|
};
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import {
|
|
3
|
-
StyleSheet,
|
|
4
|
-
TouchableWithoutFeedback,
|
|
5
|
-
View,
|
|
6
|
-
ViewStyle,
|
|
7
|
-
} from "react-native";
|
|
2
|
+
import { StyleSheet, View, ViewStyle } from "react-native";
|
|
8
3
|
import * as R from "ramda";
|
|
9
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
useIsTablet,
|
|
6
|
+
useZStore,
|
|
7
|
+
} from "@applicaster/zapp-react-native-utils/reactHooks";
|
|
8
|
+
import { playerManager } from "@applicaster/zapp-react-native-utils/appUtils";
|
|
10
9
|
|
|
11
10
|
import {
|
|
12
11
|
Button,
|
|
@@ -17,15 +16,13 @@ import {
|
|
|
17
16
|
|
|
18
17
|
import { PlayNextData } from "@applicaster/zapp-react-native-ui-components/Components/PlayerContainer/PlayerContainer";
|
|
19
18
|
|
|
20
|
-
import {
|
|
21
|
-
AnimationComponent,
|
|
22
|
-
ComponentAnimationType,
|
|
23
|
-
PlayerAnimationStateEnum,
|
|
24
|
-
useModalAnimationContext,
|
|
25
|
-
} from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation";
|
|
26
19
|
import { toNumberWithDefault } from "@applicaster/zapp-react-native-utils/numberUtils";
|
|
27
20
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
28
21
|
import { getTabBarHeight } from "@applicaster/zapp-react-native-utils/reactHooks/navigation/getTabBarHeight";
|
|
22
|
+
import { useTitleSummaryOverlay } from "@applicaster/zapp-react-native-utils/appUtils/playerManager/usePlayerTitleSummaryOverlay";
|
|
23
|
+
import { usePlayerState } from "@applicaster/zapp-react-native-utils/appUtils/playerManager/usePlayerState";
|
|
24
|
+
import { useConfiguration } from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/utils";
|
|
25
|
+
import { noop } from "@applicaster/zapp-react-native-utils/functionUtils";
|
|
29
26
|
|
|
30
27
|
const bottomTabBarHeight = getTabBarHeight();
|
|
31
28
|
|
|
@@ -34,13 +31,15 @@ type Props = {
|
|
|
34
31
|
layoutState: QuickBrickPlayer.LayoutState;
|
|
35
32
|
playerState: QuickBrickPlayer.PlayerState;
|
|
36
33
|
value: GetValue;
|
|
37
|
-
dimensions: QuickBrickPlayer.AudioPlayerProps["dimensions"];
|
|
38
34
|
onCloseVideoModal: () => void;
|
|
39
35
|
onPlayerSeek: (targetTime: number) => void;
|
|
40
36
|
playNextData: PlayNextData;
|
|
41
37
|
title: string | number;
|
|
42
38
|
summary: string | number;
|
|
43
39
|
ImageComponent?: React.ReactNode;
|
|
40
|
+
isActiveGesture?: boolean;
|
|
41
|
+
minimisedHeight: number;
|
|
42
|
+
aspectRatio?: number;
|
|
44
43
|
};
|
|
45
44
|
|
|
46
45
|
const styles = StyleSheet.create({
|
|
@@ -48,6 +47,7 @@ const styles = StyleSheet.create({
|
|
|
48
47
|
flex: 1,
|
|
49
48
|
flexDirection: "column",
|
|
50
49
|
alignItems: "stretch",
|
|
50
|
+
marginTop: 3, // from plugins/mobile-transport-controls/src/ProgressBar/layouts/DockedLayout.tsx
|
|
51
51
|
},
|
|
52
52
|
content: {
|
|
53
53
|
flex: 1,
|
|
@@ -99,26 +99,6 @@ const playerDimensionsStyle = (
|
|
|
99
99
|
width: addPadding ? toNumberWithDefault(100, minimisedHeight) : 0,
|
|
100
100
|
});
|
|
101
101
|
|
|
102
|
-
const animatedContainerStyle = (
|
|
103
|
-
docked: boolean,
|
|
104
|
-
progressBarHeight: number
|
|
105
|
-
): ViewStyle => ({
|
|
106
|
-
top: progressBarHeight,
|
|
107
|
-
position: "absolute",
|
|
108
|
-
width: "100%",
|
|
109
|
-
zIndex: docked ? 1 : -1,
|
|
110
|
-
});
|
|
111
|
-
|
|
112
|
-
const backgroundImageStyle = (
|
|
113
|
-
dimensions: QuickBrickPlayer.AudioPlayerProps["dimensions"],
|
|
114
|
-
minimisedHeight: number,
|
|
115
|
-
isActiveGesture: boolean
|
|
116
|
-
): ViewStyle => ({
|
|
117
|
-
height: isActiveGesture ? minimisedHeight : dimensions.height,
|
|
118
|
-
aspectRatio: 1,
|
|
119
|
-
position: "absolute",
|
|
120
|
-
});
|
|
121
|
-
|
|
122
102
|
const controlButtons = (
|
|
123
103
|
live: boolean,
|
|
124
104
|
paused: boolean,
|
|
@@ -180,107 +160,111 @@ export const DockedControls = (props: Props) => {
|
|
|
180
160
|
const {
|
|
181
161
|
entry,
|
|
182
162
|
layoutState,
|
|
183
|
-
|
|
184
|
-
value,
|
|
185
|
-
dimensions,
|
|
186
|
-
onCloseVideoModal,
|
|
187
|
-
onPlayerSeek,
|
|
163
|
+
onPlayerSeek = noop,
|
|
188
164
|
playNextData,
|
|
189
|
-
title,
|
|
190
|
-
summary,
|
|
191
165
|
ImageComponent,
|
|
166
|
+
isActiveGesture = true,
|
|
167
|
+
aspectRatio,
|
|
192
168
|
} = props;
|
|
193
169
|
|
|
194
|
-
const
|
|
170
|
+
const onCloseVideoModal = React.useCallback(() => {
|
|
171
|
+
playerManager.close();
|
|
172
|
+
}, []);
|
|
195
173
|
|
|
196
|
-
const
|
|
174
|
+
const { minimised_height: minimisedHeight } = useConfiguration();
|
|
197
175
|
|
|
198
|
-
const
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
176
|
+
const configuration = useZStore("playerConfiguration")();
|
|
177
|
+
const playerState = usePlayerState("shared-player-wrapper-docked");
|
|
178
|
+
|
|
179
|
+
const getValue = (key: string, stylesObj: {}) =>
|
|
180
|
+
R.propOr(null, key, stylesObj);
|
|
181
|
+
|
|
182
|
+
const value = React.useCallback(
|
|
183
|
+
(key: string) => {
|
|
184
|
+
const retVal = getValue(key, configuration);
|
|
185
|
+
|
|
186
|
+
const minimumAllowedSeekableDurationInSeconds = getValue(
|
|
187
|
+
"minimumAllowedSeekableDurationInSeconds",
|
|
188
|
+
configuration
|
|
189
|
+
);
|
|
190
|
+
|
|
191
|
+
if (key === "liveSeekingEnabled") {
|
|
192
|
+
return playerState.seekableDuration <
|
|
193
|
+
minimumAllowedSeekableDurationInSeconds || playerManager.isCasting()
|
|
194
|
+
? false
|
|
195
|
+
: retVal;
|
|
196
|
+
}
|
|
205
197
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
[]
|
|
198
|
+
return retVal;
|
|
199
|
+
},
|
|
200
|
+
[...Object.values(configuration), playerState]
|
|
201
|
+
);
|
|
202
|
+
|
|
203
|
+
const { title, summary } = useTitleSummaryOverlay(
|
|
204
|
+
entry,
|
|
205
|
+
playerState?.isLive,
|
|
206
|
+
configuration?.audio_live_player_update_interval
|
|
209
207
|
);
|
|
210
208
|
|
|
209
|
+
const isTablet = useIsTablet();
|
|
210
|
+
|
|
211
|
+
const liveButton = Boolean(value("live_badge_enabled"));
|
|
212
|
+
|
|
211
213
|
const dockedBackgroundColor = value("docked_player_background_color");
|
|
212
214
|
|
|
213
215
|
const insets = useSafeAreaInsets();
|
|
214
216
|
|
|
215
|
-
if (!layoutState.docked && !startComponentsAnimation) return null;
|
|
216
|
-
|
|
217
217
|
return (
|
|
218
|
-
<
|
|
219
|
-
animationType={ComponentAnimationType.componentAppears}
|
|
218
|
+
<View
|
|
220
219
|
style={[
|
|
221
220
|
styles.container,
|
|
222
|
-
animatedContainerStyle(
|
|
223
|
-
isActiveGesture || layoutState.docked,
|
|
224
|
-
progressBarHeight
|
|
225
|
-
),
|
|
226
221
|
{
|
|
227
222
|
height: minimisedHeight + bottomTabBarHeight + insets.bottom,
|
|
228
223
|
},
|
|
229
224
|
]}
|
|
230
225
|
>
|
|
231
|
-
{!playerState.isLive
|
|
232
|
-
(layoutState.docked || startComponentsAnimation) ? (
|
|
226
|
+
{!playerState.isLive ? (
|
|
233
227
|
<ProgressBar
|
|
234
|
-
name={"
|
|
228
|
+
name={"shared-docked-layout"}
|
|
235
229
|
content={entry}
|
|
236
230
|
value={value}
|
|
237
231
|
visible
|
|
238
232
|
layoutState={layoutState}
|
|
239
233
|
onPlayerSeek={onPlayerSeek}
|
|
240
234
|
playerState={playerState}
|
|
241
|
-
startComponentsAnimation={
|
|
235
|
+
startComponentsAnimation={noop}
|
|
242
236
|
docked
|
|
243
237
|
/>
|
|
244
238
|
) : null}
|
|
245
239
|
|
|
246
240
|
<View style={styles.content}>
|
|
247
|
-
<View
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
isActiveGesture
|
|
252
|
-
)}
|
|
253
|
-
/>
|
|
254
|
-
<TouchableWithoutFeedback onPress={maximazeVideoModal}>
|
|
255
|
-
<View style={styles.touchableArea}>
|
|
256
|
-
{isActiveGesture || layoutState.docked ? (
|
|
257
|
-
<View
|
|
258
|
-
style={{ width: toNumberWithDefault(100, minimisedHeight) }}
|
|
259
|
-
>
|
|
260
|
-
{ImageComponent || null}
|
|
261
|
-
</View>
|
|
262
|
-
) : (
|
|
263
|
-
<View
|
|
264
|
-
style={playerDimensionsStyle(
|
|
265
|
-
minimisedHeight,
|
|
266
|
-
isActiveGesture || layoutState.docked
|
|
267
|
-
)}
|
|
268
|
-
/>
|
|
269
|
-
)}
|
|
270
|
-
<View
|
|
271
|
-
style={[
|
|
272
|
-
styles.contentInfo,
|
|
273
|
-
{ backgroundColor: dockedBackgroundColor },
|
|
274
|
-
]}
|
|
275
|
-
>
|
|
276
|
-
<ContentInfo
|
|
277
|
-
content={{ ...entry, title, summary }}
|
|
278
|
-
value={value}
|
|
279
|
-
docked
|
|
280
|
-
/>
|
|
241
|
+
<View style={styles.touchableArea}>
|
|
242
|
+
{isActiveGesture || layoutState.docked ? (
|
|
243
|
+
<View style={{ aspectRatio: aspectRatio, height: minimisedHeight }}>
|
|
244
|
+
{ImageComponent || null}
|
|
281
245
|
</View>
|
|
246
|
+
) : (
|
|
247
|
+
<View
|
|
248
|
+
style={playerDimensionsStyle(
|
|
249
|
+
minimisedHeight,
|
|
250
|
+
isActiveGesture || layoutState.docked
|
|
251
|
+
)}
|
|
252
|
+
/>
|
|
253
|
+
)}
|
|
254
|
+
<View
|
|
255
|
+
testID="content-info"
|
|
256
|
+
style={[
|
|
257
|
+
styles.contentInfo,
|
|
258
|
+
{ backgroundColor: dockedBackgroundColor },
|
|
259
|
+
]}
|
|
260
|
+
>
|
|
261
|
+
<ContentInfo
|
|
262
|
+
content={{ ...entry, title, summary }}
|
|
263
|
+
value={value}
|
|
264
|
+
docked
|
|
265
|
+
/>
|
|
282
266
|
</View>
|
|
283
|
-
</
|
|
267
|
+
</View>
|
|
284
268
|
<View
|
|
285
269
|
style={[
|
|
286
270
|
isTablet
|
|
@@ -314,6 +298,6 @@ export const DockedControls = (props: Props) => {
|
|
|
314
298
|
backgroundColor: dockedBackgroundColor,
|
|
315
299
|
}}
|
|
316
300
|
/>
|
|
317
|
-
</
|
|
301
|
+
</View>
|
|
318
302
|
);
|
|
319
303
|
};
|
|
@@ -12,13 +12,12 @@ import { PlayerImage } from "./PlayerImage";
|
|
|
12
12
|
import { Controls } from "./Controls";
|
|
13
13
|
|
|
14
14
|
import { useMobileLayoutImageSize, useTransportInfoHeight } from "./hooks";
|
|
15
|
-
import { DockedControls } from "./DockedControls";
|
|
16
15
|
import { DEBUG, withDebug } from "./debug";
|
|
17
16
|
import {
|
|
18
17
|
BottomDebugSquare,
|
|
19
18
|
LeftDebugSquare,
|
|
20
19
|
RightDebugSquare,
|
|
21
|
-
} from "./
|
|
20
|
+
} from "./Debug/index";
|
|
22
21
|
|
|
23
22
|
import { Props } from "./types";
|
|
24
23
|
|
|
@@ -56,6 +55,7 @@ const mobileStyles = ({
|
|
|
56
55
|
imageSize,
|
|
57
56
|
}): ViewStyle => ({
|
|
58
57
|
height: screenHeight - topInset - bottomInset,
|
|
58
|
+
width: "100%",
|
|
59
59
|
|
|
60
60
|
opacity: imageSize ? 1 : 0, // hide content until imageSize is calculated
|
|
61
61
|
|
|
@@ -77,7 +77,6 @@ export function MobileLayout({
|
|
|
77
77
|
onSkipStart,
|
|
78
78
|
onSkipLive,
|
|
79
79
|
onSpeedButtonPress,
|
|
80
|
-
onCloseVideoModal,
|
|
81
80
|
playbackSpeedName,
|
|
82
81
|
configuration,
|
|
83
82
|
dimensions,
|
|
@@ -168,7 +167,6 @@ export function MobileLayout({
|
|
|
168
167
|
value={value}
|
|
169
168
|
configuration={configuration}
|
|
170
169
|
onPlayerSeek={onPlayerSeek}
|
|
171
|
-
onCloseVideoModal={onCloseVideoModal}
|
|
172
170
|
dimensions={dimensions}
|
|
173
171
|
playNextData={playNextData}
|
|
174
172
|
title={title}
|
|
@@ -204,19 +202,6 @@ export function MobileLayout({
|
|
|
204
202
|
/>
|
|
205
203
|
</View>
|
|
206
204
|
</View>
|
|
207
|
-
|
|
208
|
-
<DockedControls
|
|
209
|
-
entry={entry}
|
|
210
|
-
layoutState={layoutState}
|
|
211
|
-
playerState={playerState}
|
|
212
|
-
value={value}
|
|
213
|
-
dimensions={dimensions}
|
|
214
|
-
onCloseVideoModal={onCloseVideoModal}
|
|
215
|
-
onPlayerSeek={onPlayerSeek}
|
|
216
|
-
playNextData={playNextData}
|
|
217
|
-
title={title}
|
|
218
|
-
summary={summary}
|
|
219
|
-
/>
|
|
220
205
|
</View>
|
|
221
206
|
);
|
|
222
207
|
}
|
|
@@ -1,16 +1,7 @@
|
|
|
1
1
|
import React, { PropsWithChildren } from "react";
|
|
2
2
|
import { Image, Animated, StyleSheet, ImageStyle } from "react-native";
|
|
3
3
|
|
|
4
|
-
import {
|
|
5
|
-
useModalAnimationContext,
|
|
6
|
-
PlayerAnimationStateEnum,
|
|
7
|
-
DURATION_TO_MINIMIZE,
|
|
8
|
-
DURATION_TO_MAXIMIZE,
|
|
9
|
-
} from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation";
|
|
10
|
-
import { PlayerAnimationStateT } from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation/ModalAnimationContext";
|
|
11
|
-
import { useBackgroundImage } from "@applicaster/zapp-react-native-utils/audioPlayerUtils";
|
|
12
|
-
|
|
13
|
-
import { useChangePlayerState } from "./hooks";
|
|
4
|
+
import { imageSrcFromMediaItem } from "@applicaster/zapp-react-native-utils/configurationUtils";
|
|
14
5
|
|
|
15
6
|
const styles = StyleSheet.create({
|
|
16
7
|
container: {
|
|
@@ -24,48 +15,17 @@ type Props = PropsWithChildren<{
|
|
|
24
15
|
entry: ZappEntry;
|
|
25
16
|
style?: ImageStyle | ImageStyle[];
|
|
26
17
|
imageWidth: number;
|
|
27
|
-
docked: boolean;
|
|
28
18
|
}>;
|
|
29
19
|
|
|
30
|
-
export const AnimatedImage = ({ entry, style, imageWidth
|
|
20
|
+
export const AnimatedImage = ({ entry, style, imageWidth }: Props) => {
|
|
31
21
|
const heightAnim = React.useRef(new Animated.Value(imageWidth)).current;
|
|
32
22
|
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
const changePlayerState$ = useChangePlayerState({ docked });
|
|
38
|
-
|
|
39
|
-
React.useEffect(() => {
|
|
40
|
-
const subscription = changePlayerState$.subscribe({
|
|
41
|
-
next: (nextPlayerState: PlayerAnimationStateT) => {
|
|
42
|
-
if (nextPlayerState === PlayerAnimationStateEnum.minimize) {
|
|
43
|
-
Animated.timing(heightAnim, {
|
|
44
|
-
toValue: minimisedHeight,
|
|
45
|
-
duration: DURATION_TO_MINIMIZE,
|
|
46
|
-
useNativeDriver: false, // width/height can't use native driver
|
|
47
|
-
}).start();
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
if (nextPlayerState === PlayerAnimationStateEnum.maximize) {
|
|
51
|
-
Animated.timing(heightAnim, {
|
|
52
|
-
toValue: imageWidth,
|
|
53
|
-
duration: DURATION_TO_MAXIMIZE,
|
|
54
|
-
useNativeDriver: false, // width/height can't use native driver
|
|
55
|
-
}).start();
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
if (nextPlayerState === PlayerAnimationStateEnum.appear_as_docked) {
|
|
59
|
-
// minimize image immediatly
|
|
60
|
-
heightAnim.setValue(minimisedHeight);
|
|
61
|
-
}
|
|
62
|
-
},
|
|
63
|
-
});
|
|
23
|
+
const source = React.useMemo(
|
|
24
|
+
() => ({ uri: imageSrcFromMediaItem(entry, undefined) }),
|
|
25
|
+
[entry]
|
|
26
|
+
);
|
|
64
27
|
|
|
65
|
-
|
|
66
|
-
subscription.unsubscribe();
|
|
67
|
-
};
|
|
68
|
-
}, [changePlayerState$, minimisedHeight, imageWidth]);
|
|
28
|
+
if (!source) return null;
|
|
69
29
|
|
|
70
30
|
return (
|
|
71
31
|
<Animated.View
|
|
@@ -76,7 +36,7 @@ export const AnimatedImage = ({ entry, style, imageWidth, docked }: Props) => {
|
|
|
76
36
|
},
|
|
77
37
|
]}
|
|
78
38
|
>
|
|
79
|
-
<Image resizeMode="cover" style={style} source={
|
|
39
|
+
<Image resizeMode="cover" style={style} source={source} />
|
|
80
40
|
</Animated.View>
|
|
81
41
|
);
|
|
82
42
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Image, ImageStyle } from "react-native";
|
|
3
|
-
|
|
3
|
+
|
|
4
|
+
import { imageSrcFromMediaItem } from "@applicaster/zapp-react-native-utils/configurationUtils";
|
|
4
5
|
|
|
5
6
|
type Props = {
|
|
6
7
|
entry: ZappEntry;
|
|
@@ -8,9 +9,12 @@ type Props = {
|
|
|
8
9
|
};
|
|
9
10
|
|
|
10
11
|
export const FlexImage = ({ entry, style }: Props) => {
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
<Image resizeMode="cover" style={style} source={backgroundImageSource} />
|
|
12
|
+
const source = React.useMemo(
|
|
13
|
+
() => ({ uri: imageSrcFromMediaItem(entry, undefined) }),
|
|
14
|
+
[entry]
|
|
15
15
|
);
|
|
16
|
+
|
|
17
|
+
if (!source) return null;
|
|
18
|
+
|
|
19
|
+
return <Image resizeMode="cover" style={style} source={source} />;
|
|
16
20
|
};
|