@applicaster/quick-brick-player 13.0.0-rc.66 → 13.0.0-rc.67

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": "13.0.0-rc.66",
3
+ "version": "13.0.0-rc.67",
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": "13.0.0-rc.66",
40
40
  "@applicaster/quick-brick-tv-transport-controls": "13.0.0-rc.56",
41
- "@applicaster/zapp-react-native-tvos-app": "13.0.0-rc.66",
42
- "@applicaster/zapp-react-native-ui-components": "13.0.0-rc.66",
43
- "@applicaster/zapp-react-native-utils": "13.0.0-rc.66",
41
+ "@applicaster/zapp-react-native-tvos-app": "13.0.0-rc.67",
42
+ "@applicaster/zapp-react-native-ui-components": "13.0.0-rc.67",
43
+ "@applicaster/zapp-react-native-utils": "13.0.0-rc.67",
44
44
  "keymirror": "^0.1.1",
45
45
  "query-string": "7.1.3",
46
46
  "react-native-web-linear-gradient": "1.1.2",
@@ -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 } = ScreenDimensions.get("screen");
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: 463,
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: (dimensions: Dimensions, isTablet: boolean) => {
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: isTablet ? 463 : mobileValue,
119
- height: isTablet ? 463 : mobileValue,
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 { width, height } = dimensions;
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
- () => Styles.backgroundImageContainer(defaultDimensions, isTablet),
344
- [defaultDimensions, isTablet]
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: (dimensions.width - 463) / 2,
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(dimensions, isTablet)}
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 ? 95 : 40;
20
+ isLiveShowFullControls ? (isTablet ? 65 : 10) : isTablet ? undefined : 40;
21
21
 
22
22
  export const PADDING_HORIZONTAL = 15;
23
23