@applicaster/quick-brick-player 11.1.1 → 12.0.0-alpha.3021004521
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/QuickBrickPlayer.tsx +56 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applicaster/quick-brick-player",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "12.0.0-alpha.3021004521",
|
|
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": "
|
|
40
|
-
"@applicaster/quick-brick-tv-transport-controls": "11.
|
|
41
|
-
"@applicaster/zapp-react-native-tvos-app": "
|
|
42
|
-
"@applicaster/zapp-react-native-ui-components": "
|
|
43
|
-
"@applicaster/zapp-react-native-utils": "
|
|
39
|
+
"@applicaster/quick-brick-mobile-transport-controls": "12.0.0-rc.3",
|
|
40
|
+
"@applicaster/quick-brick-tv-transport-controls": "11.0.0-rc.133",
|
|
41
|
+
"@applicaster/zapp-react-native-tvos-app": "12.0.0-alpha.3021004521",
|
|
42
|
+
"@applicaster/zapp-react-native-ui-components": "12.0.0-alpha.3021004521",
|
|
43
|
+
"@applicaster/zapp-react-native-utils": "12.0.0-alpha.3021004521",
|
|
44
44
|
"keymirror": "^0.1.1",
|
|
45
45
|
"react-native-web-linear-gradient": "1.1.2",
|
|
46
46
|
"shaka-player": "4.3.5",
|
package/src/QuickBrickPlayer.tsx
CHANGED
|
@@ -1,13 +1,55 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
|
|
2
|
+
import { isNotNil } from "@applicaster/zapp-react-native-utils/reactUtils/helpers";
|
|
3
3
|
import { useOrientationEffect } from "@applicaster/zapp-react-native-utils/reactHooks/videoModal";
|
|
4
4
|
import Player from "./Player";
|
|
5
5
|
import { useActions } from "@applicaster/zapp-react-native-utils/reactHooks/actions";
|
|
6
6
|
import { isWeb } from "@applicaster/zapp-react-native-utils/reactUtils";
|
|
7
7
|
import { useNavigation } from "@applicaster/zapp-react-native-utils/reactHooks";
|
|
8
|
+
import { toBooleanWithDefaultFalse } from "@applicaster/zapp-react-native-utils/booleanUtils";
|
|
9
|
+
import { isEqual } from "@applicaster/zapp-react-native-utils/equalUtils";
|
|
10
|
+
import { toNoopIfNil } from "@applicaster/zapp-react-native-utils/functionUtils";
|
|
8
11
|
|
|
9
12
|
const CHROMECAST_IDENTIFIER = "quick-brick-chromecast-action";
|
|
10
13
|
|
|
14
|
+
const MemoizedPlayer = React.memo(
|
|
15
|
+
Player,
|
|
16
|
+
isEqual({
|
|
17
|
+
byValue: [
|
|
18
|
+
"PlayerComponent",
|
|
19
|
+
"autoplay",
|
|
20
|
+
"controls",
|
|
21
|
+
"disableCastAction",
|
|
22
|
+
"docked",
|
|
23
|
+
"focused",
|
|
24
|
+
"fullscreen",
|
|
25
|
+
"inline",
|
|
26
|
+
"isModal",
|
|
27
|
+
"isTabletPortrait",
|
|
28
|
+
"muted",
|
|
29
|
+
"playerId",
|
|
30
|
+
"playerPluginIdentifier",
|
|
31
|
+
"mode",
|
|
32
|
+
"style",
|
|
33
|
+
],
|
|
34
|
+
byReference: [
|
|
35
|
+
"controller",
|
|
36
|
+
"listener",
|
|
37
|
+
"playNextData",
|
|
38
|
+
"entry",
|
|
39
|
+
"playableItem",
|
|
40
|
+
"source",
|
|
41
|
+
"playerEvent",
|
|
42
|
+
"playerPluginManifest",
|
|
43
|
+
"pluginConfiguration",
|
|
44
|
+
"setNextVideoPreloadThresholdPercentage",
|
|
45
|
+
"toggleFullscreen",
|
|
46
|
+
"openPiP",
|
|
47
|
+
"closePiP",
|
|
48
|
+
"castAction",
|
|
49
|
+
],
|
|
50
|
+
})
|
|
51
|
+
);
|
|
52
|
+
|
|
11
53
|
const QuickBrickPlayerComponent = (
|
|
12
54
|
props: QuickBrickPlayer.PlayerProps,
|
|
13
55
|
ref
|
|
@@ -25,7 +67,7 @@ const QuickBrickPlayerComponent = (
|
|
|
25
67
|
|
|
26
68
|
const castAction = useActions(CHROMECAST_IDENTIFIER);
|
|
27
69
|
|
|
28
|
-
const isModal =
|
|
70
|
+
const isModal = toBooleanWithDefaultFalse(props?.isModal);
|
|
29
71
|
const isScreenDisabled = !controller?.isFullScreenSupported() || !isModal;
|
|
30
72
|
|
|
31
73
|
const {
|
|
@@ -35,16 +77,24 @@ const QuickBrickPlayerComponent = (
|
|
|
35
77
|
} = useNavigation();
|
|
36
78
|
|
|
37
79
|
useOrientationEffect({
|
|
38
|
-
isTabletPortrait: props?.isTabletPortrait,
|
|
80
|
+
isTabletPortrait: toBooleanWithDefaultFalse(props?.isTabletPortrait),
|
|
39
81
|
docked: mode === "MINIMIZED",
|
|
40
|
-
toggleFullscreen: props?.toggleFullscreen,
|
|
82
|
+
toggleFullscreen: toNoopIfNil(props?.toggleFullscreen),
|
|
41
83
|
disable: isScreenDisabled,
|
|
42
84
|
skipInitialOrientationEffects: mode === "FULLSCREEN",
|
|
43
|
-
isRunningPlayNext:
|
|
85
|
+
isRunningPlayNext: isNotNil(props?.playNextData),
|
|
44
86
|
});
|
|
45
87
|
|
|
88
|
+
// console.log("debug_2", "QuickBrickPlayerComponent - render", {
|
|
89
|
+
// mode,
|
|
90
|
+
// props,
|
|
91
|
+
// disableCastAction: props?.disableCastAction,
|
|
92
|
+
// castAction,
|
|
93
|
+
// PlayerComponent: props.PlayerComponent,
|
|
94
|
+
// });
|
|
95
|
+
|
|
46
96
|
return (
|
|
47
|
-
<
|
|
97
|
+
<MemoizedPlayer
|
|
48
98
|
{...props}
|
|
49
99
|
ref={ref}
|
|
50
100
|
castAction={!props?.disableCastAction && castAction}
|