@applicaster/quick-brick-player 12.0.0-alpha.3120641745 → 12.0.0-alpha.3132044100

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.0-alpha.3120641745",
3
+ "version": "12.0.0-alpha.3132044100",
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-alpha.3120641745",
39
+ "@applicaster/quick-brick-mobile-transport-controls": "12.0.0-rc.33",
40
40
  "@applicaster/quick-brick-tv-transport-controls": "11.0.0-rc.133",
41
- "@applicaster/zapp-react-native-tvos-app": "12.0.0-alpha.3120641745",
42
- "@applicaster/zapp-react-native-ui-components": "12.0.0-alpha.3120641745",
43
- "@applicaster/zapp-react-native-utils": "12.0.0-alpha.3120641745",
41
+ "@applicaster/zapp-react-native-tvos-app": "12.0.0-alpha.3132044100",
42
+ "@applicaster/zapp-react-native-ui-components": "12.0.0-alpha.3132044100",
43
+ "@applicaster/zapp-react-native-utils": "12.0.0-alpha.3132044100",
44
44
  "keymirror": "^0.1.1",
45
45
  "query-string": "7.1.3",
46
46
  "react-native-web-linear-gradient": "1.1.2",
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import { ViewStyle, View } from "react-native";
2
+ import { ViewStyle, View, ScrollView } from "react-native";
3
3
 
4
4
  import { SafeAreaView, Edge } from "react-native-safe-area-context";
5
5
  import { usePlayerState } from "@applicaster/zapp-react-native-utils/appUtils/playerManager/usePlayerState";
@@ -26,12 +26,6 @@ import {
26
26
  import { localStorage } from "@applicaster/zapp-react-native-bridge/ZappStorage/LocalStorage";
27
27
  import { addQueryParam, getLiveUrl } from "../Utils";
28
28
  import { useTitleSummaryOverlay } from "@applicaster/zapp-react-native-utils/appUtils/playerManager/usePlayerTitleSummaryOverlay";
29
- import {
30
- AnimationComponent,
31
- ComponentAnimationType,
32
- AnimatedScrollModal,
33
- } from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation";
34
- import { PADDING_HORIZONTAL } from "./Layout/defaultLayoutsConts";
35
29
 
36
30
  const { log_debug } = createLogger({
37
31
  subsystem: "UIComponent",
@@ -74,20 +68,29 @@ export const defaultAspectRatioWidth = (height: number): number =>
74
68
  (height / 9) * 16;
75
69
 
76
70
  const Styles = {
77
- mainContainer: (style: ViewStyle) => {
71
+ mainContainer: (docked: boolean, style: ViewStyle) => {
78
72
  const combinedStyle: ViewStyle = {
79
73
  flex: 1,
80
74
  };
81
75
 
82
- return {
83
- ...combinedStyle,
84
- ...style,
85
- };
76
+ if (!docked) {
77
+ style.paddingTop = 0;
78
+ style.paddingHorizontal = 15;
79
+ }
80
+
81
+ return { ...combinedStyle, ...style };
86
82
  },
87
- playerContainer: {
88
- flex: 1,
83
+ playerContainer: (docked: boolean, style: ViewStyle) => {
84
+ const combinedStyle: ViewStyle = {
85
+ flex: 1,
86
+ };
87
+
88
+ if (docked) {
89
+ combinedStyle.height = style.height;
90
+ }
91
+
92
+ return combinedStyle;
89
93
  },
90
- paddingHorizontal: { paddingTop: 0, paddingHorizontal: PADDING_HORIZONTAL },
91
94
 
92
95
  controlsMobile: {
93
96
  height: 50,
@@ -165,9 +168,6 @@ export const AudioPlayerWrapper: React.FC<Props> = (props: Props) => {
165
168
 
166
169
  const [sleepTimerDate, setSleepTimerDate] = useState(0);
167
170
 
168
- const [defaultDimensions, setDefaultDimensions] =
169
- React.useState<Dimensions>(undefined);
170
-
171
171
  const [dimensions, setDimensions] = React.useState<Dimensions>({
172
172
  width: 0,
173
173
  height: 0,
@@ -181,11 +181,9 @@ export const AudioPlayerWrapper: React.FC<Props> = (props: Props) => {
181
181
  const { width, height } = event.nativeEvent.layout;
182
182
 
183
183
  setDimensions({
184
- width,
184
+ width: docked ? defaultAspectRatioWidth(height) : width,
185
185
  height,
186
186
  });
187
-
188
- if (!defaultDimensions) setDefaultDimensions({ width, height });
189
187
  };
190
188
 
191
189
  const cancelSleepTimer = async () => {
@@ -377,64 +375,58 @@ export const AudioPlayerWrapper: React.FC<Props> = (props: Props) => {
377
375
  player?.seekTo(0);
378
376
  }, [player]);
379
377
 
380
- const edges = React.useMemo<Edge[]>(() => ["right", "left", "top"], [docked]);
378
+ const edges = React.useMemo<Edge[]>(
379
+ () => (docked ? [] : ["right", "left", "top"]),
380
+ [docked]
381
+ );
381
382
 
382
- const ContainerView = SafeAreaView;
383
+ const ContainerView = docked ? View : SafeAreaView;
383
384
 
384
385
  const MainContent = React.useMemo(() => {
385
386
  return (
386
- <ContainerView style={Styles.mainContainer(style)} edges={edges}>
387
- <AnimationComponent
388
- animationType={ComponentAnimationType.moveUpComponent}
389
- additionalData={{ saveArea: true }}
387
+ <ContainerView style={Styles.mainContainer(docked, style)} edges={edges}>
388
+ <ScrollView
389
+ style={Styles.playerContainer(docked, style)}
390
+ onLayout={onLayout}
390
391
  >
391
- <AnimatedScrollModal>
392
- <View style={Styles.playerContainer} onLayout={onLayout}>
393
- <Layout
394
- entry={entry}
395
- playerState={playerState}
396
- layoutState={layoutState}
397
- value={value}
398
- onPlaybackButtonPress={onPlaybackButtonPress}
399
- onRewindButtonPress={onRewindButtonPress}
400
- onForwardButtonPress={onForwardButtonPress}
401
- onPlayerSeek={onPlayerSeek}
402
- onSkipStart={onSkipStart}
403
- onSpeedButtonPress={onSpeedButtonPress}
404
- onSleepButtonPress={onSleepButtonPress}
405
- playbackSpeedName={formatSpeed(playbackSpeed.value)}
406
- playbackSleepName={
407
- sleepTimer.value === 0 ? "sleep_timer" : "sleep_timer_active"
408
- }
409
- sleepTimerDate={sleepTimerDate}
410
- cancelSleepTimer={cancelSleepTimer}
411
- onSkipLive={onSkipLive}
412
- onCloseVideoModal={onCloseVideoModal}
413
- maximiseVideoModal={maximiseVideoModal}
414
- configuration={configuration}
415
- dimensions={dimensions}
416
- playNextData={playNextData}
417
- title={title}
418
- summary={summary}
419
- defaultDimensions={defaultDimensions}
420
- />
421
- <View style={Styles.paddingHorizontal}>
422
- {children}
423
- <AnimationComponent
424
- animationType={ComponentAnimationType.componentFade}
425
- >
426
- <PlayerDetails
427
- configuration={configuration}
428
- style={Styles.playerDetails}
429
- entry={entry}
430
- isTabletLandscape={isTabletLandscape}
431
- isAudioPlayer={true}
432
- />
433
- </AnimationComponent>
434
- </View>
435
- </View>
436
- </AnimatedScrollModal>
437
- </AnimationComponent>
392
+ <Layout
393
+ entry={entry}
394
+ playerState={playerState}
395
+ layoutState={layoutState}
396
+ value={value}
397
+ onPlaybackButtonPress={onPlaybackButtonPress}
398
+ onRewindButtonPress={onRewindButtonPress}
399
+ onForwardButtonPress={onForwardButtonPress}
400
+ onPlayerSeek={onPlayerSeek}
401
+ onSkipStart={onSkipStart}
402
+ onSpeedButtonPress={onSpeedButtonPress}
403
+ onSleepButtonPress={onSleepButtonPress}
404
+ playbackSpeedName={formatSpeed(playbackSpeed.value)}
405
+ playbackSleepName={
406
+ sleepTimer.value === 0 ? "sleep_timer" : "sleep_timer_active"
407
+ }
408
+ sleepTimerDate={sleepTimerDate}
409
+ cancelSleepTimer={cancelSleepTimer}
410
+ onSkipLive={onSkipLive}
411
+ onCloseVideoModal={onCloseVideoModal}
412
+ maximiseVideoModal={maximiseVideoModal}
413
+ configuration={configuration}
414
+ dimensions={dimensions}
415
+ playNextData={playNextData}
416
+ title={title}
417
+ summary={summary}
418
+ />
419
+ {children}
420
+ {!docked && (
421
+ <PlayerDetails
422
+ configuration={configuration}
423
+ style={Styles.playerDetails}
424
+ entry={entry}
425
+ isTabletLandscape={isTabletLandscape}
426
+ isAudioPlayer={true}
427
+ />
428
+ )}
429
+ </ScrollView>
438
430
  </ContainerView>
439
431
  );
440
432
  }, [
@@ -18,21 +18,13 @@ import {
18
18
  rewindButton,
19
19
  skipToStartButton,
20
20
  skipToLiveButton,
21
- PADDING_HORIZONTAL,
22
21
  speedButton,
23
22
  sleepButton,
24
23
  } from "./defaultLayoutsConts";
25
24
  import { AudioDescription } from "../AudioDescription";
26
25
  import { PlayerImageBackground } from "@applicaster/zapp-react-native-ui-components/Components/PlayerImageBackground";
27
26
  import { useLanguageData } from "@applicaster/zapp-react-native-utils/reactHooks/player";
28
- import { PlayNextData } from "@applicaster/zapp-react-native-ui-components/Components/PlayerContainer/PlayerContainer";
29
27
  import { useEffect, useMemo, useState } from "react";
30
- import {
31
- useModalAnimationContext,
32
- AnimationComponent,
33
- ComponentAnimationType,
34
- } from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation";
35
- import DockedLayout from "./DockedLayout";
36
28
 
37
29
  type Dimensions = {
38
30
  width: number;
@@ -68,13 +60,9 @@ type LayoutProps = {
68
60
  onPlayerSeek: (targetTime: number) => void;
69
61
  onSkipLive: () => void;
70
62
  onSkipStart: () => void;
71
- onCloseVideoModal: () => void;
72
- maximiseVideoModal: () => void;
73
63
  dimensions: Dimensions;
74
- playNextData: PlayNextData;
75
64
  title: string | number;
76
65
  summary: string | number;
77
- defaultDimensions: Dimensions;
78
66
  };
79
67
 
80
68
  const Styles = {
@@ -84,13 +72,10 @@ const Styles = {
84
72
  alignItems: "center",
85
73
  justifyContent: isPortraitMode ? "center" : "flex-start",
86
74
  }),
87
- playerImageWrapper: {
88
- width: "100%",
89
- maxHeight: 750,
90
- marginTop: 80,
91
- },
92
75
  tabletLayout: {
93
76
  width: 463,
77
+ maxHeight: 750,
78
+ marginTop: 80,
94
79
  marginBottom: 80,
95
80
  },
96
81
  controls: (isTablet: boolean, isLiveShowFullControls: boolean) => ({
@@ -99,31 +84,24 @@ const Styles = {
99
84
  justifyContent: isLiveShowFullControls ? "space-between" : "space-evenly",
100
85
  }),
101
86
  backgroundImageContainer: (dimensions: Dimensions, isTablet: boolean) => {
102
- const mobileValue = dimensions.width
103
- ? dimensions.width - PADDING_HORIZONTAL * 2
104
- : 330;
105
-
106
87
  return {
107
- width: isTablet ? 463 : mobileValue,
108
- height: isTablet ? 463 : mobileValue,
88
+ width: isTablet ? 463 : dimensions.width || 330,
89
+ height: isTablet ? 463 : dimensions.width || 330,
109
90
  };
110
91
  },
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,
92
+ backgroundImageContainerImageStyle: (isTablet) => ({
93
+ borderRadius: isTablet ? 24 : 10,
123
94
  }),
95
+ playerContainer: (docked: boolean, style) => {
96
+ const combinedStyle = {
97
+ flex: 1,
98
+ };
99
+
100
+ if (docked) {
101
+ combinedStyle["height"] = style.height;
102
+ }
124
103
 
125
- paddingHorizontal: {
126
- paddingHorizontal: PADDING_HORIZONTAL,
104
+ return combinedStyle;
127
105
  },
128
106
 
129
107
  controlsMobile: {
@@ -137,12 +115,6 @@ const Styles = {
137
115
  separator: {
138
116
  height: 20,
139
117
  },
140
- flexDirectionRow: {
141
- flexDirection: "row",
142
- },
143
- alignItemsCenter: {
144
- alignItems: "center",
145
- },
146
118
  };
147
119
 
148
120
  export default function DefaultLayout(props: LayoutProps) {
@@ -167,14 +139,12 @@ export default function DefaultLayout(props: LayoutProps) {
167
139
  sleepTimerDate,
168
140
  title,
169
141
  summary,
170
- defaultDimensions,
171
142
  } = props;
172
143
 
173
144
  const isTablet = useIsTablet();
174
145
  const { width, height } = dimensions;
175
146
  const isPortraitMode = width < height;
176
147
  const isLiveContent = playerState.isLive;
177
- const docked = layoutState.docked;
178
148
 
179
149
  const languageData = useLanguageData("audio-player");
180
150
 
@@ -313,120 +283,71 @@ export default function DefaultLayout(props: LayoutProps) {
313
283
  const needsToShowProgressBar =
314
284
  (isLiveContent && liveSeekingEnabled) || !isLiveContent;
315
285
 
316
- const defaultImageDimensions = React.useMemo(
317
- () =>
318
- defaultDimensions &&
319
- Styles.backgroundImageContainer(defaultDimensions, isTablet),
320
- [defaultDimensions]
321
- );
322
-
323
- const { isActiveGesture, startComponentsAnimation } =
324
- useModalAnimationContext();
325
-
326
286
  return (
327
287
  <View
328
288
  style={
329
289
  isTablet ? Styles.tabletContainer(isPortraitMode) : Styles.container
330
290
  }
331
291
  >
332
- <AnimationComponent animationType={ComponentAnimationType.componentFade}>
333
- <TransportInfo
334
- content={entry}
335
- value={value}
336
- visible={true}
337
- languageData={languageData}
338
- layoutState={layoutState}
339
- actionButtons={actionButtons}
340
- />
341
- </AnimationComponent>
342
- <AnimationComponent
343
- animationType={ComponentAnimationType.moveUpComponent}
344
- style={isTablet ? Styles.playerImageWrapper : null}
292
+ <TransportInfo
293
+ content={entry}
294
+ value={value}
295
+ visible={true}
296
+ languageData={languageData}
297
+ layoutState={layoutState}
298
+ actionButtons={actionButtons}
299
+ />
300
+ <View
301
+ style={
302
+ isTablet ? Styles.tabletContainer(isPortraitMode) : Styles.container
303
+ }
345
304
  >
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
- },
356
- }
357
- : null,
358
- }}
359
- style={isTablet ? Styles.alignItemsCenter : null}
360
- >
305
+ <View style={isTablet ? Styles.tabletLayout : null}>
361
306
  <PlayerImageBackground
362
307
  entry={entry}
363
308
  style={Styles.backgroundImageContainer(dimensions, isTablet)}
364
- imageStyle={Styles.backgroundImageContainerImageStyle(
365
- isTablet,
366
- docked,
367
- startComponentsAnimation,
368
- isActiveGesture
369
- )}
370
- defaultImageDimensions={defaultImageDimensions}
309
+ imageStyle={Styles.backgroundImageContainerImageStyle(isTablet)}
371
310
  />
372
- </AnimationComponent>
373
-
374
- <DockedLayout {...props} />
375
- </AnimationComponent>
376
- <View
377
- style={[
378
- Styles.paddingHorizontal,
379
- isTablet ? Styles.tabletLayout : null,
380
- ]}
381
- >
382
- {!docked && (
383
- <AnimationComponent
384
- animationType={ComponentAnimationType.componentFade}
385
- >
386
- <AudioDescription
387
- title={title}
388
- summary={summary}
389
- value={value}
390
- layoutState={layoutState}
391
- />
392
- <Separator />
393
- {needsToShowProgressBar && (
394
- <View>
395
- <ProgressBar
396
- content={entry}
311
+ <AudioDescription
312
+ title={title}
313
+ summary={summary}
314
+ value={value}
315
+ layoutState={layoutState}
316
+ />
317
+ <Separator />
318
+ {needsToShowProgressBar && (
319
+ <View>
320
+ <ProgressBar
321
+ content={entry}
322
+ value={value}
323
+ visible={true}
324
+ layoutState={layoutState}
325
+ onPlayerSeek={onPlayerSeek}
326
+ playerState={playerState}
327
+ disableFullscreen={true}
328
+ sliderStyle={2}
329
+ />
330
+
331
+ {showCounter && timeLeft >= 0 && (
332
+ <CountDown
333
+ timeLeft={timeLeft}
397
334
  value={value}
398
- visible={true}
399
- layoutState={layoutState}
400
- onPlayerSeek={onPlayerSeek}
401
- playerState={playerState}
402
- disableFullscreen={true}
403
- sliderStyle={2}
335
+ title={sleepTitle}
404
336
  />
405
-
406
- {showCounter && timeLeft >= 0 && (
407
- <CountDown
408
- timeLeft={timeLeft}
409
- value={value}
410
- title={sleepTitle}
411
- />
412
- )}
413
-
414
- <Separator />
415
- </View>
416
- )}
417
- <Controls
418
- value={value}
419
- visible={true}
420
- keepAlive={null}
421
- buttons={controlButtons}
422
- style={Styles.controls(
423
- isTablet,
424
- isLiveContent && showFullControls
425
337
  )}
426
- playerState={playerState}
427
- />
428
- </AnimationComponent>
429
- )}
338
+
339
+ <Separator />
340
+ </View>
341
+ )}
342
+ <Controls
343
+ value={value}
344
+ visible={true}
345
+ keepAlive={null}
346
+ buttons={controlButtons}
347
+ style={Styles.controls(isTablet, isLiveContent && showFullControls)}
348
+ playerState={playerState}
349
+ />
350
+ </View>
430
351
  </View>
431
352
  </View>
432
353
  );
@@ -15,13 +15,8 @@ import {
15
15
  Button,
16
16
  } from "@applicaster/quick-brick-mobile-transport-controls";
17
17
 
18
+ import { PlayerImageBackground } from "@applicaster/zapp-react-native-ui-components/Components/PlayerImageBackground";
18
19
  import { PlayNextData } from "@applicaster/zapp-react-native-ui-components/Components/PlayerContainer/PlayerContainer";
19
- import {
20
- useModalAnimationContext,
21
- AnimationComponent,
22
- ComponentAnimationType,
23
- PlayerAnimationStateEnum,
24
- } from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation";
25
20
 
26
21
  type Dimensions = {
27
22
  width: number;
@@ -109,26 +104,14 @@ const backgroundColorStyle = (value: GetValue): ViewStyle => ({
109
104
  backgroundColor: value("docked_player_background_color"),
110
105
  });
111
106
 
112
- const playerDimensionsStyle = (
113
- minimisedHeight: number,
114
- addPadding: boolean
115
- ): ViewStyle => ({
116
- paddingLeft: addPadding ? minimisedHeight || 100 : 0,
107
+ const playerDimensionsStyle = ({
108
+ height,
109
+ }: PlayerDimensionsProp): ViewStyle => ({
110
+ paddingLeft: height || 100,
117
111
  });
118
112
 
119
- const animatedContainerStyle = (docked: boolean): ViewStyle => ({
120
- top: docked ? 2 : null,
121
- position: "absolute",
122
- width: "100%",
123
- zIndex: docked ? 1 : -1,
124
- });
125
-
126
- const backgroundImageStyle = (
127
- dimensions: Dimensions,
128
- minimisedHeight: number,
129
- isActiveGesture: boolean
130
- ): ViewStyle => ({
131
- height: isActiveGesture ? minimisedHeight : dimensions.height,
113
+ const backgroundImageStyle = (dimensions: Dimensions): ViewStyle => ({
114
+ height: dimensions.height,
132
115
  aspectRatio: 1,
133
116
  position: "absolute",
134
117
  });
@@ -210,6 +193,7 @@ export default function DockedLayout(props: LayoutProps) {
210
193
  dimensions,
211
194
  entry,
212
195
  onCloseVideoModal,
196
+ maximiseVideoModal,
213
197
  onPlayerSeek,
214
198
  playerState,
215
199
  configuration,
@@ -223,29 +207,9 @@ export default function DockedLayout(props: LayoutProps) {
223
207
  const visible = true;
224
208
  const liveButton = Boolean(value("live_badge_enabled"));
225
209
 
226
- const {
227
- isActiveGesture,
228
- setPlayerAnimationState,
229
- startComponentsAnimation,
230
- minimisedHeight,
231
- } = useModalAnimationContext();
232
-
233
- const maximazeVideoModal = React.useCallback(
234
- () => setPlayerAnimationState(PlayerAnimationStateEnum.maximaze),
235
- []
236
- );
237
-
238
- if (!layoutState.docked && !startComponentsAnimation) return null;
239
-
240
210
  return (
241
- <AnimationComponent
242
- animationType={ComponentAnimationType.componentAppears}
243
- style={[
244
- styles.container,
245
- animatedContainerStyle(isActiveGesture || layoutState.docked),
246
- ]}
247
- >
248
- {!playerState.isLive && layoutState.docked && (
211
+ <View style={styles.container}>
212
+ {!playerState.isLive && (
249
213
  <ProgressBar
250
214
  content={entry}
251
215
  value={value}
@@ -253,27 +217,18 @@ export default function DockedLayout(props: LayoutProps) {
253
217
  layoutState={layoutState}
254
218
  onPlayerSeek={onPlayerSeek}
255
219
  playerState={playerState}
256
- docked
257
220
  />
258
221
  )}
259
222
 
260
223
  <View style={styles.content}>
261
- <View
262
- style={backgroundImageStyle(
263
- dimensions,
264
- minimisedHeight,
265
- isActiveGesture
266
- )}
224
+ <PlayerImageBackground
225
+ configuration={configuration}
226
+ entry={entry}
227
+ style={backgroundImageStyle(dimensions)}
267
228
  />
268
- <TouchableWithoutFeedback onPress={maximazeVideoModal}>
229
+ <TouchableWithoutFeedback onPress={maximiseVideoModal}>
269
230
  <View
270
- style={[
271
- styles.touchableArea,
272
- playerDimensionsStyle(
273
- minimisedHeight,
274
- isActiveGesture || layoutState.docked
275
- ),
276
- ]}
231
+ style={[styles.touchableArea, playerDimensionsStyle(dimensions)]}
277
232
  >
278
233
  <View
279
234
  style={[
@@ -317,6 +272,6 @@ export default function DockedLayout(props: LayoutProps) {
317
272
  />
318
273
  </View>
319
274
  </View>
320
- </AnimationComponent>
275
+ </View>
321
276
  );
322
277
  }
@@ -19,8 +19,6 @@ const playbackButtonMargins = (
19
19
  ): number =>
20
20
  isLiveShowFullControls ? (isTablet ? 65 : 10) : isTablet ? 95 : 40;
21
21
 
22
- export const PADDING_HORIZONTAL = 15;
23
-
24
22
  export const playbackButton = ({
25
23
  playerState,
26
24
  liveButton,
@@ -1,5 +1,6 @@
1
1
  import React from "react";
2
2
  import DefaultLayout from "./DefaultLayout";
3
+ import DockedLayout from "./DockedLayout";
3
4
  import { PlayNextData } from "@applicaster/zapp-react-native-ui-components/Components/PlayerContainer/PlayerContainer";
4
5
 
5
6
  type Dimensions = {
@@ -39,7 +40,6 @@ type LayoutProps = {
39
40
  onSkipLive: () => void;
40
41
  maximiseVideoModal: () => void;
41
42
  dimensions: Dimensions;
42
- defaultDimensions: Dimensions;
43
43
  playNextData: PlayNextData;
44
44
  title: string | number;
45
45
  summary: string | number;
@@ -48,5 +48,11 @@ type LayoutProps = {
48
48
  export default function Layout(
49
49
  props: LayoutProps
50
50
  ): React.ReactElement<LayoutProps> {
51
+ const { layoutState } = props;
52
+
53
+ if (layoutState.docked) {
54
+ return <DockedLayout {...props} />;
55
+ }
56
+
51
57
  return <DefaultLayout {...props} />;
52
58
  }
@@ -38,10 +38,6 @@ 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 {
42
- AnimationComponent,
43
- ComponentAnimationType,
44
- } from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation";
45
41
 
46
42
  const RNPlayerManager = {
47
43
  QuickBrickPlayerPlugin: isApplePlatform()
@@ -61,7 +57,6 @@ const styles = StyleSheet.create({
61
57
  position: "absolute",
62
58
  zIndex: 1,
63
59
  },
64
- playerSize: { width: "100%", height: "100%" },
65
60
  });
66
61
 
67
62
  const logger = createLogger({
@@ -1103,24 +1098,11 @@ export default class VideoPlayer extends React.Component<
1103
1098
  <View style={styles.container}>
1104
1099
  <View style={[playerContainerStyles, playerDimensions]}>
1105
1100
  {isAudioItem && (
1106
- <AnimationComponent
1107
- animationType={ComponentAnimationType.player}
1108
- additionalData={{
1109
- ...playerDimensions,
1110
- inlineAudioPlayer: true,
1111
- }}
1112
- style={getStyle(playerDimensions)}
1113
- >
1114
- <AudioPlayer
1115
- style={
1116
- isTV()
1117
- ? getStyle(playerDimensions)
1118
- : styles.playerSize
1119
- }
1120
- audio_item={entry}
1121
- plugin_configuration={this.getPluginConfiguration()}
1122
- />
1123
- </AnimationComponent>
1101
+ <AudioPlayer
1102
+ style={playerDimensions}
1103
+ audio_item={entry}
1104
+ plugin_configuration={this.getPluginConfiguration()}
1105
+ />
1124
1106
  )}
1125
1107
 
1126
1108
  {shouldRenderBackground && (
@@ -1133,27 +1115,17 @@ export default class VideoPlayer extends React.Component<
1133
1115
  )}
1134
1116
 
1135
1117
  {!castAction?.state?.connected && (
1136
- <AnimationComponent
1137
- animationType={ComponentAnimationType.player}
1138
- additionalData={playerDimensions}
1118
+ <this.props.PlayerComponent
1119
+ ref={this._assignRoot}
1120
+ {...nativeEvents}
1121
+ {...nativeProps}
1122
+ listener={this.props.listener}
1139
1123
  style={getStyle(playerDimensions)}
1124
+ pluginConfiguration={this.getPluginConfiguration()}
1125
+ controller={this.props.controller}
1140
1126
  >
1141
- <this.props.PlayerComponent
1142
- ref={this._assignRoot}
1143
- {...nativeEvents}
1144
- {...nativeProps}
1145
- listener={this.props.listener}
1146
- style={
1147
- isTV()
1148
- ? getStyle(playerDimensions)
1149
- : styles.playerSize
1150
- }
1151
- pluginConfiguration={this.getPluginConfiguration()}
1152
- controller={this.props.controller}
1153
- >
1154
- {this.childrenWithPlayNext()}
1155
- </this.props.PlayerComponent>
1156
- </AnimationComponent>
1127
+ {this.childrenWithPlayNext()}
1128
+ </this.props.PlayerComponent>
1157
1129
  )}
1158
1130
  </View>
1159
1131