@applicaster/quick-brick-player 17.0.0-alpha.1037440043 → 17.0.0-alpha.1201533844

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": "17.0.0-alpha.1037440043",
3
+ "version": "17.0.0-alpha.1201533844",
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": "16.0.0-rc.127",
39
39
  "@applicaster/quick-brick-tv-transport-controls": "16.0.0-rc.127",
40
- "@applicaster/zapp-react-native-tvos-app": "17.0.0-alpha.1037440043",
41
- "@applicaster/zapp-react-native-ui-components": "17.0.0-alpha.1037440043",
42
- "@applicaster/zapp-react-native-utils": "17.0.0-alpha.1037440043",
40
+ "@applicaster/zapp-react-native-tvos-app": "17.0.0-alpha.1201533844",
41
+ "@applicaster/zapp-react-native-ui-components": "17.0.0-alpha.1201533844",
42
+ "@applicaster/zapp-react-native-utils": "17.0.0-alpha.1201533844",
43
43
  "query-string": "7.1.3",
44
44
  "shaka-player": "4.3.5",
45
45
  "typeface-montserrat": "^0.0.54",
@@ -0,0 +1,35 @@
1
+ import { Platform } from "react-native";
2
+ import { isTV } from "@applicaster/zapp-react-native-utils/reactUtils";
3
+
4
+ import * as mobileControls from "../mobileControls";
5
+ import * as webStandIns from "../mobileControls.web";
6
+
7
+ describe("mobile player controls in web builds", () => {
8
+ const originalOS = Platform.OS;
9
+
10
+ afterEach(() => {
11
+ Platform.OS = originalOS;
12
+ });
13
+
14
+ // The web stand-ins are safe only because Player renders `isTV() ? renderTV() : renderMobile()`.
15
+ it.each(["web", "samsung_tv", "lg_tv"])(
16
+ "%s always takes the TV render path",
17
+ (platform) => {
18
+ Platform.OS = platform as typeof Platform.OS;
19
+
20
+ expect(isTV()).toBe(true);
21
+ }
22
+ );
23
+
24
+ it("provides every control the mobile module exports", () => {
25
+ expect(Object.keys(webStandIns).sort()).toEqual(
26
+ Object.keys(mobileControls).sort()
27
+ );
28
+ });
29
+
30
+ it("renders nothing for each stand-in", () => {
31
+ Object.values(webStandIns).forEach((StandIn) => {
32
+ expect((StandIn as () => null)()).toBeNull();
33
+ });
34
+ });
35
+ });
@@ -5,11 +5,14 @@
5
5
  import React from "react";
6
6
  import * as R from "ramda";
7
7
 
8
- import { findNodeHandle, StyleSheet, View, ViewStyle } from "react-native";
8
+ import {
9
+ Dimensions,
10
+ findNodeHandle,
11
+ StyleSheet,
12
+ View,
13
+ ViewStyle,
14
+ } from "react-native";
9
15
 
10
- import TransportControlsMobile, {
11
- ErrorOverlay,
12
- } from "@applicaster/quick-brick-mobile-transport-controls";
13
16
  import TransportControlsTV, {
14
17
  ErrorOverlay as TVErrorOverlay,
15
18
  } from "@applicaster/quick-brick-tv-transport-controls";
@@ -47,10 +50,15 @@ import {
47
50
  isAudioItem as isAudioItemUtil,
48
51
  isInlineTV as isInlineTVUtil,
49
52
  } from "@applicaster/zapp-react-native-utils/playerUtils";
53
+ import { useIsTablet as getIsTablet } from "@applicaster/zapp-react-native-utils/reactHooks";
50
54
 
51
55
  import { TVPlayerView } from "./PlayerView/TVPlayerView";
52
56
  import PlayerModal, { VideoPlayerModal } from "./PlayerModal";
53
- import { DockedControls } from "./AudioLayer/Layout/DockedControls";
57
+ import {
58
+ DockedControls,
59
+ ErrorOverlay,
60
+ TransportControlsMobile,
61
+ } from "./mobileControls";
54
62
  import { FlexImage } from "./AudioLayer/Layout/PlayerImage/FlexImage";
55
63
  import { PlayerError } from "@applicaster/zapp-react-native-utils/appUtils/playerManager/const";
56
64
 
@@ -1390,8 +1398,25 @@ export default class VideoPlayer extends React.Component<
1390
1398
 
1391
1399
  const shouldRenderNativePlayer = !isCasting || this.supportNativeCast;
1392
1400
 
1393
- const aspectRatio =
1394
- !inline && isModal && !piped ? getScreenAspectRatio() : 16 / 9;
1401
+ // Vertical inline on a landscape tablet fills the column height. The
1402
+ // minimise animation and the docked slot both use this ratio, so it has
1403
+ // to describe that box (column width / screen height), not 16:9.
1404
+ const isVerticalInlineTabletLandscape =
1405
+ vertical &&
1406
+ inline &&
1407
+ isModal &&
1408
+ !piped &&
1409
+ getIsTablet() &&
1410
+ !isTabletPortrait;
1411
+
1412
+ const aspectRatio = isVerticalInlineTabletLandscape
1413
+ ? getTabletWidth(
1414
+ pluginConfiguration.tablet_landscape_sidebar_width,
1415
+ style
1416
+ ) / Dimensions.get("window").height
1417
+ : !inline && isModal && !piped
1418
+ ? getScreenAspectRatio()
1419
+ : 16 / 9;
1395
1420
 
1396
1421
  const audioPlayerProps = {
1397
1422
  ref: this._assignRoot,
@@ -0,0 +1,7 @@
1
+ // Controls only the mobile player renders (Player's renderMobile path). Web builds resolve mobileControls.web.ts.
2
+ export {
3
+ default as TransportControlsMobile,
4
+ ErrorOverlay,
5
+ } from "@applicaster/quick-brick-mobile-transport-controls";
6
+
7
+ export { DockedControls } from "./AudioLayer/Layout/DockedControls";
@@ -0,0 +1,10 @@
1
+ // Web builds always render the TV player: Player renders `isTV() ? renderTV() : renderMobile()`, and isTV() is true on
2
+ // every web platform. The mobile controls are never rendered there, so web bundles get empty stand-ins and leave the
3
+ // mobile transport controls package out.
4
+ const NotRenderedOnWeb = () => null;
5
+
6
+ export const TransportControlsMobile = NotRenderedOnWeb;
7
+
8
+ export const ErrorOverlay = NotRenderedOnWeb;
9
+
10
+ export const DockedControls = NotRenderedOnWeb;