@applicaster/quick-brick-player 12.0.0-alpha.3021004521 → 12.0.0-alpha.3510522252
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.
|
|
3
|
+
"version": "12.0.0-alpha.3510522252",
|
|
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-rc.
|
|
39
|
+
"@applicaster/quick-brick-mobile-transport-controls": "12.0.0-rc.11",
|
|
40
40
|
"@applicaster/quick-brick-tv-transport-controls": "11.0.0-rc.133",
|
|
41
|
-
"@applicaster/zapp-react-native-tvos-app": "12.0.0-alpha.
|
|
42
|
-
"@applicaster/zapp-react-native-ui-components": "12.0.0-alpha.
|
|
43
|
-
"@applicaster/zapp-react-native-utils": "12.0.0-alpha.
|
|
41
|
+
"@applicaster/zapp-react-native-tvos-app": "12.0.0-alpha.3510522252",
|
|
42
|
+
"@applicaster/zapp-react-native-ui-components": "12.0.0-alpha.3510522252",
|
|
43
|
+
"@applicaster/zapp-react-native-utils": "12.0.0-alpha.3510522252",
|
|
44
44
|
"keymirror": "^0.1.1",
|
|
45
45
|
"react-native-web-linear-gradient": "1.1.2",
|
|
46
46
|
"shaka-player": "4.3.5",
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
|
|
11
11
|
import { playerManager } from "@applicaster/zapp-react-native-utils/appUtils";
|
|
12
12
|
|
|
13
|
-
import { useIsTablet } from "@applicaster/zapp-react-native-utils/reactHooks
|
|
13
|
+
import { useIsTablet } from "@applicaster/zapp-react-native-utils/reactHooks";
|
|
14
14
|
import {
|
|
15
15
|
forwardButton,
|
|
16
16
|
playbackButton,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from "react";
|
|
1
|
+
import * as React from "react";
|
|
2
2
|
import {
|
|
3
3
|
StyleSheet,
|
|
4
4
|
TouchableWithoutFeedback,
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
ViewStyle,
|
|
7
7
|
} from "react-native";
|
|
8
8
|
import * as R from "ramda";
|
|
9
|
-
import {
|
|
9
|
+
import { useIsTablet } from "@applicaster/zapp-react-native-utils/reactHooks";
|
|
10
10
|
|
|
11
11
|
import {
|
|
12
12
|
ContentInfo,
|
|
@@ -198,9 +198,7 @@ export default function DockedLayout(props: LayoutProps) {
|
|
|
198
198
|
playNextData,
|
|
199
199
|
} = props;
|
|
200
200
|
|
|
201
|
-
const
|
|
202
|
-
deviceInfo: { isTablet },
|
|
203
|
-
} = useDimensions("screen", { deviceInfo: true });
|
|
201
|
+
const isTablet = useIsTablet();
|
|
204
202
|
|
|
205
203
|
const visible = true;
|
|
206
204
|
const liveButton = Boolean(value("live_badge_enabled"));
|
package/src/Player/index.tsx
CHANGED
|
@@ -36,6 +36,10 @@ import { AudioPlayerWrapper } from "./AudioLayer/AudioPlayerWrapper";
|
|
|
36
36
|
import { playerManager } from "@applicaster/zapp-react-native-utils/appUtils";
|
|
37
37
|
import { getAllAccessibilityProps } from "@applicaster/zapp-react-native-utils/configurationUtils";
|
|
38
38
|
import { PlayNextData } from "@applicaster/zapp-react-native-ui-components/Components/PlayerContainer/PlayerContainer";
|
|
39
|
+
import {
|
|
40
|
+
getTargetScreenDataFromEntry
|
|
41
|
+
} from "@applicaster/zapp-react-native-utils/reactHooks/screen/useTargetScreenData";
|
|
42
|
+
import { isAppleTV } from "@applicaster/zapp-react-native-ui-components/Helpers/Platform";
|
|
39
43
|
|
|
40
44
|
const RNPlayerManager = {
|
|
41
45
|
QuickBrickPlayerPlugin: isApplePlatform()
|
|
@@ -755,7 +759,6 @@ export default class VideoPlayer extends React.Component<
|
|
|
755
759
|
render() {
|
|
756
760
|
const {
|
|
757
761
|
castAction,
|
|
758
|
-
controls,
|
|
759
762
|
docked,
|
|
760
763
|
entry,
|
|
761
764
|
fullscreen,
|
|
@@ -812,16 +815,32 @@ export default class VideoPlayer extends React.Component<
|
|
|
812
815
|
const liveCatchUpEnabled =
|
|
813
816
|
this.props.pluginConfiguration?.liveCatchUpEnabled;
|
|
814
817
|
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
+
// TODO: Get screen data more reliable way useCurrentScreenData
|
|
819
|
+
const screenData = getTargetScreenDataFromEntry(this.props.playableItem);
|
|
820
|
+
|
|
821
|
+
const isInlineTV = screenData?.ui_components?.length > 0 && isTV();
|
|
818
822
|
|
|
819
|
-
|
|
823
|
+
let platformSpecificProps: any = isApplePlatform()
|
|
820
824
|
? {
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
+
resizeMode: nativeResizeMode,
|
|
826
|
+
} : {};
|
|
827
|
+
|
|
828
|
+
const supportsNativeControls = !!this.props.controller?.supportsNativeControls?.();
|
|
829
|
+
|
|
830
|
+
const controls = isAppleTV()
|
|
831
|
+
? supportsNativeControls && isInlineTV && !this.getPlayNextData()
|
|
832
|
+
: supportsNativeControls && !this.getPlayNextData();
|
|
833
|
+
|
|
834
|
+
platformSpecificProps = {
|
|
835
|
+
...platformSpecificProps,
|
|
836
|
+
controls
|
|
837
|
+
};
|
|
838
|
+
|
|
839
|
+
console.log("Anton Player render2 ", {
|
|
840
|
+
platformSpecificProps,
|
|
841
|
+
isNotInlineTv: !isInlineTV,
|
|
842
|
+
hasNoPlayNextData: !this.getPlayNextData()
|
|
843
|
+
});
|
|
825
844
|
|
|
826
845
|
const pictureInPictureEnabled =
|
|
827
846
|
this.props.pluginConfiguration?.pictureInPictureEnabled;
|
|
@@ -830,7 +849,6 @@ export default class VideoPlayer extends React.Component<
|
|
|
830
849
|
entry, // Must be passed first in list
|
|
831
850
|
...platformSpecificProps,
|
|
832
851
|
audioTrackId,
|
|
833
|
-
controls,
|
|
834
852
|
docked,
|
|
835
853
|
enableAutoAudioTrackSelection,
|
|
836
854
|
fullscreen, // TODO: Check fullscreen params not crash
|
|
@@ -958,6 +976,8 @@ export default class VideoPlayer extends React.Component<
|
|
|
958
976
|
? styles.playerContainerTransparent
|
|
959
977
|
: styles.playerContainerBlack;
|
|
960
978
|
|
|
979
|
+
console.log("Anton Player render", {screenData, props: this.props, nativeProps});
|
|
980
|
+
|
|
961
981
|
const isInline = () => {
|
|
962
982
|
if (isTV()) {
|
|
963
983
|
return inline;
|
|
@@ -1005,10 +1025,12 @@ export default class VideoPlayer extends React.Component<
|
|
|
1005
1025
|
inline,
|
|
1006
1026
|
docked,
|
|
1007
1027
|
isModal,
|
|
1028
|
+
pip: this.state.piped,
|
|
1008
1029
|
layoutState: {
|
|
1009
1030
|
inline,
|
|
1010
1031
|
docked,
|
|
1011
1032
|
isModal,
|
|
1033
|
+
pip: this.state.piped,
|
|
1012
1034
|
},
|
|
1013
1035
|
configuration: this.getPluginConfiguration(),
|
|
1014
1036
|
fullscreen: fullscreen,
|
|
@@ -1085,6 +1107,7 @@ export default class VideoPlayer extends React.Component<
|
|
|
1085
1107
|
listener={this.props.listener}
|
|
1086
1108
|
style={getStyle(playerDimensions)}
|
|
1087
1109
|
pluginConfiguration={this.getPluginConfiguration()}
|
|
1110
|
+
controller={this.props.controller}
|
|
1088
1111
|
>
|
|
1089
1112
|
{this.childrenWithPlayNext()}
|
|
1090
1113
|
</this.props.PlayerComponent>
|
|
@@ -1121,6 +1144,7 @@ export default class VideoPlayer extends React.Component<
|
|
|
1121
1144
|
listener={this.props.listener}
|
|
1122
1145
|
style={this.takeParentStyle}
|
|
1123
1146
|
pluginConfiguration={this.getPluginConfiguration()}
|
|
1147
|
+
controller={this.props.controller}
|
|
1124
1148
|
>
|
|
1125
1149
|
{this.childrenWithPlayNext()}
|
|
1126
1150
|
</this.props.PlayerComponent>
|
package/src/QuickBrickPlayer.tsx
CHANGED
|
@@ -1,55 +1,13 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
|
|
2
|
+
|
|
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";
|
|
11
8
|
|
|
12
9
|
const CHROMECAST_IDENTIFIER = "quick-brick-chromecast-action";
|
|
13
10
|
|
|
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
|
-
|
|
53
11
|
const QuickBrickPlayerComponent = (
|
|
54
12
|
props: QuickBrickPlayer.PlayerProps,
|
|
55
13
|
ref
|
|
@@ -67,7 +25,7 @@ const QuickBrickPlayerComponent = (
|
|
|
67
25
|
|
|
68
26
|
const castAction = useActions(CHROMECAST_IDENTIFIER);
|
|
69
27
|
|
|
70
|
-
const isModal =
|
|
28
|
+
const isModal = Boolean(props?.isModal);
|
|
71
29
|
const isScreenDisabled = !controller?.isFullScreenSupported() || !isModal;
|
|
72
30
|
|
|
73
31
|
const {
|
|
@@ -77,24 +35,16 @@ const QuickBrickPlayerComponent = (
|
|
|
77
35
|
} = useNavigation();
|
|
78
36
|
|
|
79
37
|
useOrientationEffect({
|
|
80
|
-
isTabletPortrait:
|
|
38
|
+
isTabletPortrait: props?.isTabletPortrait,
|
|
81
39
|
docked: mode === "MINIMIZED",
|
|
82
|
-
toggleFullscreen:
|
|
40
|
+
toggleFullscreen: props?.toggleFullscreen,
|
|
83
41
|
disable: isScreenDisabled,
|
|
84
42
|
skipInitialOrientationEffects: mode === "FULLSCREEN",
|
|
85
|
-
isRunningPlayNext:
|
|
43
|
+
isRunningPlayNext: !!props?.playNextData,
|
|
86
44
|
});
|
|
87
45
|
|
|
88
|
-
// console.log("debug_2", "QuickBrickPlayerComponent - render", {
|
|
89
|
-
// mode,
|
|
90
|
-
// props,
|
|
91
|
-
// disableCastAction: props?.disableCastAction,
|
|
92
|
-
// castAction,
|
|
93
|
-
// PlayerComponent: props.PlayerComponent,
|
|
94
|
-
// });
|
|
95
|
-
|
|
96
46
|
return (
|
|
97
|
-
<
|
|
47
|
+
<Player
|
|
98
48
|
{...props}
|
|
99
49
|
ref={ref}
|
|
100
50
|
castAction={!props?.disableCastAction && castAction}
|