@applicaster/quick-brick-player 14.0.0-rc.7 → 14.0.0-rc.71
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 -11
- package/src/Player/AudioLayer/AudioPlayerWrapper.tsx +25 -81
- package/src/Player/AudioLayer/Layout/Controls/index.tsx +8 -18
- package/src/Player/AudioLayer/Layout/DockedControls/index.tsx +119 -119
- package/src/Player/AudioLayer/Layout/MobileLayout.tsx +5 -38
- package/src/Player/AudioLayer/Layout/PlayerImage/AnimatedImage.tsx +3 -8
- package/src/Player/AudioLayer/Layout/PlayerImage/FlexImage.tsx +5 -9
- package/src/Player/AudioLayer/Layout/PlayerImage/index.tsx +22 -72
- package/src/Player/AudioLayer/Layout/TabletLandscapeLayout.tsx +1 -58
- package/src/Player/AudioLayer/Layout/TabletPortraitLayout.tsx +0 -33
- package/src/Player/AudioLayer/Layout/TransportInfo/index.tsx +6 -18
- package/src/Player/AudioLayer/components/SleepTimerModalHeader/SleepTimerModalHeader.tsx +1 -1
- package/src/Player/PlayerModal/GestureAnimatedScrollView.ts +7 -0
- package/src/Player/PlayerModal/PlayerModal.tsx +109 -0
- package/src/Player/PlayerModal/VideoPlayerModal.tsx +271 -0
- package/src/Player/PlayerModal/consts/index.ts +34 -0
- package/src/Player/PlayerModal/context/index.ts +6 -0
- package/src/Player/PlayerModal/hooks/index.ts +193 -0
- package/src/Player/PlayerModal/index.ts +3 -0
- package/src/Player/PlayerModal/index.web.ts +5 -0
- package/src/Player/PlayerModal/styles.ts +104 -0
- package/src/Player/PlayerView/GenericTVPlayerView.tsx +42 -0
- package/src/Player/PlayerView/TVPlayerView.tsx +26 -0
- package/src/Player/PlayerView/TvOSPlayerView.tsx +51 -0
- package/src/Player/PlayerView/types.ts +42 -0
- package/src/Player/index.tsx +187 -190
- package/src/QuickBrickPlayer.tsx +16 -10
- /package/src/Player/AudioLayer/Layout/{Debug → DebugComponent}/index.tsx +0 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { View } from "react-native";
|
|
3
|
+
import { PlayNextOverlay } from "../PlayNextOverlay";
|
|
4
|
+
import { TvOSPlayerViewProps } from "./types";
|
|
5
|
+
|
|
6
|
+
const AUDIO_PLAYER_NATIVE_ID = "audio-player-view";
|
|
7
|
+
|
|
8
|
+
export const TvOSPlayerView: React.FC<TvOSPlayerViewProps> = ({
|
|
9
|
+
children,
|
|
10
|
+
type,
|
|
11
|
+
PlayerComponent,
|
|
12
|
+
pluginConfiguration,
|
|
13
|
+
playerProps,
|
|
14
|
+
playNextProps,
|
|
15
|
+
nativePlayerIsReady,
|
|
16
|
+
transportControls,
|
|
17
|
+
entry,
|
|
18
|
+
inline,
|
|
19
|
+
}) => {
|
|
20
|
+
return (
|
|
21
|
+
<>
|
|
22
|
+
<PlayerComponent
|
|
23
|
+
pluginConfiguration={pluginConfiguration}
|
|
24
|
+
{...playerProps}
|
|
25
|
+
>
|
|
26
|
+
{!inline ? (
|
|
27
|
+
<>
|
|
28
|
+
{type === "audio" && nativePlayerIsReady ? (
|
|
29
|
+
<View
|
|
30
|
+
nativeID={AUDIO_PLAYER_NATIVE_ID}
|
|
31
|
+
key={AUDIO_PLAYER_NATIVE_ID}
|
|
32
|
+
>
|
|
33
|
+
{children}
|
|
34
|
+
</View>
|
|
35
|
+
) : (
|
|
36
|
+
children
|
|
37
|
+
)}
|
|
38
|
+
{playNextProps.playNextData ? (
|
|
39
|
+
<PlayNextOverlay
|
|
40
|
+
item={entry}
|
|
41
|
+
pluginConfiguration={pluginConfiguration}
|
|
42
|
+
{...playNextProps}
|
|
43
|
+
/>
|
|
44
|
+
) : null}
|
|
45
|
+
</>
|
|
46
|
+
) : null}
|
|
47
|
+
</PlayerComponent>
|
|
48
|
+
{transportControls}
|
|
49
|
+
</>
|
|
50
|
+
);
|
|
51
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ReactNode, ComponentType } from "react";
|
|
2
|
+
import { PlayNextData } from "@applicaster/zapp-react-native-ui-components/Components/PlayerContainer/PlayerContainer";
|
|
3
|
+
import { ViewStyle } from "react-native";
|
|
4
|
+
|
|
5
|
+
export interface PlayNextOverlayProps {
|
|
6
|
+
playerIsDocked: boolean;
|
|
7
|
+
playerId?: string;
|
|
8
|
+
playNextData: PlayNextData;
|
|
9
|
+
setNextVideoPreloadThresholdPercentage: (percentage: number) => void;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface PlayerComponentProps {
|
|
13
|
+
ref: React.RefObject<any>;
|
|
14
|
+
listener: Record<string, any>;
|
|
15
|
+
configuration: Record<string, any>;
|
|
16
|
+
style: ViewStyle;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface AudioPlayerProps {
|
|
20
|
+
style: ViewStyle;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface PlayerViewBaseProps {
|
|
24
|
+
children?: ReactNode;
|
|
25
|
+
type: "audio" | "video";
|
|
26
|
+
entry: ZappEntry;
|
|
27
|
+
pluginConfiguration: Record<string, any>;
|
|
28
|
+
PlayerComponent: ComponentType<any>;
|
|
29
|
+
playerProps: PlayerComponentProps;
|
|
30
|
+
playNextProps: PlayNextOverlayProps;
|
|
31
|
+
audioPlayerProps: AudioPlayerProps;
|
|
32
|
+
transportControls?: ReactNode;
|
|
33
|
+
inline?: boolean;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface TvOSPlayerViewProps extends PlayerViewBaseProps {
|
|
37
|
+
nativePlayerIsReady: boolean;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export type GenericTVPlayerViewProps = PlayerViewBaseProps;
|
|
41
|
+
|
|
42
|
+
export type TVPlayerViewProps = TvOSPlayerViewProps | GenericTVPlayerViewProps;
|
package/src/Player/index.tsx
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
/* eslint-disable react-native/no-inline-styles */
|
|
1
2
|
/* eslint-disable @typescript-eslint/no-use-before-define */
|
|
2
3
|
/* eslint-disable react-native/no-color-literals */
|
|
3
4
|
|
|
4
5
|
import React from "react";
|
|
5
6
|
import * as R from "ramda";
|
|
6
7
|
|
|
7
|
-
import {
|
|
8
|
+
import { findNodeHandle, StyleSheet, View, Dimensions } from "react-native";
|
|
8
9
|
|
|
9
|
-
import { findNodeHandle, StyleSheet, View } from "react-native";
|
|
10
10
|
import TransportControlsMobile from "@applicaster/quick-brick-mobile-transport-controls";
|
|
11
11
|
import TransportControlsTV from "@applicaster/quick-brick-tv-transport-controls";
|
|
12
12
|
|
|
@@ -19,7 +19,10 @@ import {
|
|
|
19
19
|
isWeb,
|
|
20
20
|
} from "@applicaster/zapp-react-native-utils/reactUtils";
|
|
21
21
|
|
|
22
|
-
import {
|
|
22
|
+
import {
|
|
23
|
+
PlayerDetails,
|
|
24
|
+
PlayerWrapper,
|
|
25
|
+
} from "@applicaster/zapp-react-native-ui-components/Components/VideoModal";
|
|
23
26
|
|
|
24
27
|
import { PlayNextOverlay } from "./PlayNextOverlay";
|
|
25
28
|
import { PlayerImageBackground } from "@applicaster/zapp-react-native-ui-components/Components/PlayerImageBackground";
|
|
@@ -33,19 +36,22 @@ import { playerManager } from "@applicaster/zapp-react-native-utils/appUtils";
|
|
|
33
36
|
import { getAllAccessibilityProps } from "@applicaster/zapp-react-native-utils/configurationUtils";
|
|
34
37
|
import { PlayNextData } from "@applicaster/zapp-react-native-ui-components/Components/PlayerContainer/PlayerContainer";
|
|
35
38
|
import { getTargetScreenDataFromEntry } from "@applicaster/zapp-react-native-utils/reactHooks/screen/useTargetScreenData";
|
|
36
|
-
import {
|
|
37
|
-
AnimationComponent,
|
|
38
|
-
ComponentAnimationType,
|
|
39
|
-
} from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation";
|
|
40
39
|
import { PlayerAnalyticsManager } from "@applicaster/zapp-react-native-utils/analyticsUtils/PlayerAnalyticsManager";
|
|
41
40
|
import { PlayerAnalyticsTrackerI } from "@applicaster/zapp-react-native-utils/analyticsUtils/playerAnalyticsTracker";
|
|
42
41
|
|
|
43
42
|
import { RNPlayerManager } from "@applicaster/zapp-react-native-utils/appUtils/playerManager/nativePlayerManager";
|
|
44
43
|
import {
|
|
44
|
+
getTabletWidth,
|
|
45
45
|
isAudioItem as isAudioItemUtil,
|
|
46
46
|
isInlineTV as isInlineTVUtil,
|
|
47
47
|
} from "@applicaster/zapp-react-native-utils/playerUtils";
|
|
48
48
|
|
|
49
|
+
import { TVPlayerView } from "./PlayerView/TVPlayerView";
|
|
50
|
+
import PlayerModal, { VideoPlayerModal } from "./PlayerModal";
|
|
51
|
+
import { DockedControls } from "./AudioLayer/Layout/DockedControls";
|
|
52
|
+
import { FlexImage } from "./AudioLayer/Layout/PlayerImage/FlexImage";
|
|
53
|
+
import { PlayerError } from "@applicaster/zapp-react-native-utils/appUtils/playerManager/conts";
|
|
54
|
+
|
|
49
55
|
const styles = StyleSheet.create({
|
|
50
56
|
container: { flex: 1 },
|
|
51
57
|
playerContainerBlack: { backgroundColor: DEFAULT_COLORS.black },
|
|
@@ -55,8 +61,8 @@ const styles = StyleSheet.create({
|
|
|
55
61
|
position: "absolute",
|
|
56
62
|
zIndex: 1,
|
|
57
63
|
},
|
|
58
|
-
audioPlayerSize: { width: "100%", height: "100%" },
|
|
59
64
|
playerSize: { width: "100%", height: "100%" },
|
|
65
|
+
flexImage: { height: "100%", aspectRatio: 1, flex: -1 },
|
|
60
66
|
});
|
|
61
67
|
|
|
62
68
|
const logger = createLogger({
|
|
@@ -66,7 +72,14 @@ const logger = createLogger({
|
|
|
66
72
|
|
|
67
73
|
const isTvOS = isTvOSPlatform();
|
|
68
74
|
|
|
69
|
-
const
|
|
75
|
+
const { width: SCREEN_WIDTH, height: SCREEN_HEIGHT } = Dimensions.get("screen");
|
|
76
|
+
|
|
77
|
+
const getScreenAspectRatio = () => {
|
|
78
|
+
const longEdge = Math.max(SCREEN_WIDTH, SCREEN_HEIGHT);
|
|
79
|
+
const shortEdge = Math.min(SCREEN_WIDTH, SCREEN_HEIGHT);
|
|
80
|
+
|
|
81
|
+
return longEdge / shortEdge;
|
|
82
|
+
};
|
|
70
83
|
|
|
71
84
|
export default class VideoPlayer extends React.Component<
|
|
72
85
|
QuickBrickPlayer.PlayerProps,
|
|
@@ -404,9 +417,12 @@ export default class VideoPlayer extends React.Component<
|
|
|
404
417
|
|
|
405
418
|
// TODO: Should be unified on both platform
|
|
406
419
|
onVideoError = ({ nativeEvent }) => {
|
|
407
|
-
const
|
|
420
|
+
const description = nativeEvent.message;
|
|
421
|
+
const error = nativeEvent.error || nativeEvent.exception || "Unknown error"; // Android only fallback
|
|
422
|
+
|
|
423
|
+
const newError = new PlayerError(error, description);
|
|
408
424
|
|
|
409
|
-
return this.props?.listener?.onError(
|
|
425
|
+
return this.props?.listener?.onError(newError);
|
|
410
426
|
};
|
|
411
427
|
|
|
412
428
|
onPlayerPause = ({ nativeEvent = null }) => {
|
|
@@ -688,53 +704,6 @@ export default class VideoPlayer extends React.Component<
|
|
|
688
704
|
}
|
|
689
705
|
};
|
|
690
706
|
|
|
691
|
-
childrenWithExtensions = () => {
|
|
692
|
-
const { docked, entry, children } = this.props;
|
|
693
|
-
|
|
694
|
-
if (!isTvOS) {
|
|
695
|
-
return children;
|
|
696
|
-
}
|
|
697
|
-
|
|
698
|
-
const output = [];
|
|
699
|
-
|
|
700
|
-
// audio-player
|
|
701
|
-
if (isAudioItemUtil(entry)) {
|
|
702
|
-
const { nativePlayerIsReady } = this.state;
|
|
703
|
-
|
|
704
|
-
// we have to wait ready status of native player view, before showing audio_player
|
|
705
|
-
if (nativePlayerIsReady) {
|
|
706
|
-
output.push(
|
|
707
|
-
<View nativeID={AUDIO_PLAYER_NATIVE_ID} key={AUDIO_PLAYER_NATIVE_ID}>
|
|
708
|
-
{children}
|
|
709
|
-
</View>
|
|
710
|
-
);
|
|
711
|
-
}
|
|
712
|
-
} else {
|
|
713
|
-
output.push(children);
|
|
714
|
-
}
|
|
715
|
-
// audio-player
|
|
716
|
-
|
|
717
|
-
// play-next
|
|
718
|
-
if (this.getPlayNextData()) {
|
|
719
|
-
output.push(
|
|
720
|
-
<PlayNextOverlay
|
|
721
|
-
key="play-next-overlay"
|
|
722
|
-
item={entry}
|
|
723
|
-
playerIsDocked={docked}
|
|
724
|
-
pluginConfiguration={this.getPluginConfiguration()}
|
|
725
|
-
playerId={this.props.playerId}
|
|
726
|
-
playNextData={this.getPlayNextData()}
|
|
727
|
-
setNextVideoPreloadThresholdPercentage={
|
|
728
|
-
this.props.setNextVideoPreloadThresholdPercentage
|
|
729
|
-
}
|
|
730
|
-
/>
|
|
731
|
-
);
|
|
732
|
-
}
|
|
733
|
-
// play-next
|
|
734
|
-
|
|
735
|
-
return flatten(output); // prevent possible case with nested array
|
|
736
|
-
};
|
|
737
|
-
|
|
738
707
|
get supportNativeCast() {
|
|
739
708
|
return this.props.controller.supportNativeCast();
|
|
740
709
|
}
|
|
@@ -828,7 +797,7 @@ export default class VideoPlayer extends React.Component<
|
|
|
828
797
|
};
|
|
829
798
|
|
|
830
799
|
const isFullScreenAudioPlayer =
|
|
831
|
-
this.getPluginConfiguration()?.
|
|
800
|
+
this.getPluginConfiguration()?.full_screen_audio_player || false;
|
|
832
801
|
|
|
833
802
|
const isAudioPlayer = isFullScreenAudioPlayer && isAudioItem;
|
|
834
803
|
|
|
@@ -870,7 +839,7 @@ export default class VideoPlayer extends React.Component<
|
|
|
870
839
|
this.isReactNativeMethodsSupported() &&
|
|
871
840
|
RNPlayerManager?.[this.playerPluginId]?.play
|
|
872
841
|
) {
|
|
873
|
-
delete nativeProps
|
|
842
|
+
delete nativeProps.paused;
|
|
874
843
|
}
|
|
875
844
|
|
|
876
845
|
const adEvents = {
|
|
@@ -1021,159 +990,187 @@ export default class VideoPlayer extends React.Component<
|
|
|
1021
990
|
pip: this.state.piped,
|
|
1022
991
|
},
|
|
1023
992
|
configuration: this.getPluginConfiguration(),
|
|
1024
|
-
|
|
1025
|
-
isTabletPortrait: isTabletPortrait,
|
|
993
|
+
isTabletPortrait,
|
|
1026
994
|
playNextData: this.getPlayNextData(),
|
|
1027
995
|
};
|
|
1028
996
|
|
|
1029
|
-
const containerStyle = { flex: 1 };
|
|
1030
|
-
|
|
1031
997
|
const backgroundImageKey =
|
|
1032
998
|
this.getPluginConfiguration()?.player_preview_image_key;
|
|
1033
999
|
|
|
1034
1000
|
const shouldRenderNativePlayer =
|
|
1035
1001
|
!this.props.isCasting || this.supportNativeCast;
|
|
1036
1002
|
|
|
1003
|
+
const aspectRatio =
|
|
1004
|
+
!inline && isModal && !this.state.piped ? getScreenAspectRatio() : 16 / 9;
|
|
1005
|
+
|
|
1037
1006
|
const renderMobilePlayer = () => {
|
|
1038
1007
|
return isFullScreenAudioPlayer && isAudioItem ? (
|
|
1039
1008
|
// Ensure the View remains in the native hierarchy for proper rendering and interaction
|
|
1040
|
-
<
|
|
1041
|
-
{
|
|
1042
|
-
<
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1009
|
+
<PlayerModal
|
|
1010
|
+
content={
|
|
1011
|
+
<View collapsable={false} style={styles.container}>
|
|
1012
|
+
{shouldRenderNativePlayer ? (
|
|
1013
|
+
<this.props.PlayerComponent
|
|
1014
|
+
ref={this._assignRoot}
|
|
1015
|
+
{...nativeEvents}
|
|
1016
|
+
{...nativeProps}
|
|
1017
|
+
listener={this.props.listener}
|
|
1018
|
+
/>
|
|
1019
|
+
) : null}
|
|
1020
|
+
<AudioPlayerWrapper {...sharedWrapperViewProps} />
|
|
1021
|
+
</View>
|
|
1022
|
+
}
|
|
1023
|
+
collapsedContent={
|
|
1024
|
+
<View style={styles.container}>
|
|
1025
|
+
<DockedControls
|
|
1026
|
+
entry={entry}
|
|
1027
|
+
aspectRatio={1}
|
|
1028
|
+
layoutState={sharedWrapperViewProps.layoutState}
|
|
1029
|
+
playNextData={sharedWrapperViewProps.playNextData}
|
|
1030
|
+
ImageComponent={
|
|
1031
|
+
<FlexImage entry={entry} style={styles.flexImage} />
|
|
1032
|
+
}
|
|
1033
|
+
/>
|
|
1034
|
+
</View>
|
|
1035
|
+
}
|
|
1036
|
+
/>
|
|
1051
1037
|
) : (
|
|
1052
|
-
<
|
|
1053
|
-
{
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1038
|
+
<VideoPlayerModal
|
|
1039
|
+
isTabletPortrait={isTabletPortrait}
|
|
1040
|
+
aspectRatio={aspectRatio}
|
|
1041
|
+
pip={this.state.piped}
|
|
1042
|
+
fullscreen={fullscreen}
|
|
1043
|
+
modal={isModal}
|
|
1044
|
+
style={{
|
|
1045
|
+
tabletLandscapeWidth: getTabletWidth(
|
|
1046
|
+
this.getPluginConfiguration().tablet_landscape_sidebar_width,
|
|
1047
|
+
style
|
|
1048
|
+
),
|
|
1049
|
+
width: style.width,
|
|
1050
|
+
height: style.height,
|
|
1051
|
+
}}
|
|
1052
|
+
content={
|
|
1053
|
+
<PlayerWrapper
|
|
1054
|
+
{...sharedWrapperViewProps}
|
|
1055
|
+
// eslint-disable-next-line react/no-unstable-nested-components
|
|
1056
|
+
playerContent={(playerDimensions) => {
|
|
1057
|
+
const shouldRenderBackground =
|
|
1058
|
+
!R.isNil(backgroundImageKey) &&
|
|
1059
|
+
backgroundImageKey.length > 0 &&
|
|
1060
|
+
!this.onVideoLoadCalled &&
|
|
1061
|
+
!this.state.isAd;
|
|
1062
|
+
|
|
1063
|
+
return (
|
|
1064
|
+
<View style={styles.container}>
|
|
1065
|
+
<View style={[playerContainerStyles, playerDimensions]}>
|
|
1066
|
+
{isAudioItem ? (
|
|
1067
|
+
<AudioPlayer
|
|
1068
|
+
style={styles.playerSize}
|
|
1069
|
+
audio_item={entry}
|
|
1070
|
+
plugin_configuration={this.getPluginConfiguration()}
|
|
1071
|
+
/>
|
|
1072
|
+
) : null}
|
|
1073
|
+
|
|
1074
|
+
{shouldRenderBackground ? (
|
|
1075
|
+
<PlayerImageBackground
|
|
1076
|
+
imageKey={backgroundImageKey}
|
|
1077
|
+
configuration={this.getPluginConfiguration()}
|
|
1078
|
+
entry={entry}
|
|
1079
|
+
style={getBackgroundImageStyle(playerDimensions)}
|
|
1080
|
+
/>
|
|
1081
|
+
) : null}
|
|
1082
|
+
|
|
1083
|
+
{shouldRenderNativePlayer ? (
|
|
1084
|
+
<View style={getStyle(playerDimensions)}>
|
|
1085
|
+
<this.props.PlayerComponent
|
|
1086
|
+
ref={this._assignRoot}
|
|
1087
|
+
{...nativeEvents}
|
|
1088
|
+
{...nativeProps}
|
|
1089
|
+
listener={this.props.listener}
|
|
1090
|
+
style={styles.playerSize}
|
|
1091
|
+
pluginConfiguration={this.getPluginConfiguration()}
|
|
1092
|
+
controller={this.props.controller}
|
|
1093
|
+
>
|
|
1094
|
+
{this.props.children}
|
|
1095
|
+
</this.props.PlayerComponent>
|
|
1096
|
+
</View>
|
|
1097
|
+
) : null}
|
|
1098
|
+
</View>
|
|
1099
|
+
|
|
1100
|
+
{renderTransportControls(playerDimensions)}
|
|
1101
|
+
{!this.state.piped && (
|
|
1102
|
+
<PlayNextOverlay
|
|
1103
|
+
item={entry}
|
|
1104
|
+
playerIsDocked={docked}
|
|
1105
|
+
pluginConfiguration={this.getPluginConfiguration()}
|
|
1106
|
+
playerId={this.props.playerId}
|
|
1107
|
+
playNextData={this.getPlayNextData()}
|
|
1108
|
+
setNextVideoPreloadThresholdPercentage={
|
|
1109
|
+
this.props.setNextVideoPreloadThresholdPercentage
|
|
1077
1110
|
}
|
|
1078
|
-
audio_item={entry}
|
|
1079
|
-
plugin_configuration={this.getPluginConfiguration()}
|
|
1080
1111
|
/>
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
: styles.playerSize
|
|
1111
|
-
}
|
|
1112
|
-
pluginConfiguration={this.getPluginConfiguration()}
|
|
1113
|
-
controller={this.props.controller}
|
|
1114
|
-
>
|
|
1115
|
-
{this.props.children}
|
|
1116
|
-
</this.props.PlayerComponent>
|
|
1117
|
-
</AnimationComponent>
|
|
1118
|
-
) : null}
|
|
1119
|
-
</View>
|
|
1120
|
-
|
|
1121
|
-
{renderTransportControls(playerDimensions)}
|
|
1122
|
-
{!this.state.piped && (
|
|
1123
|
-
<PlayNextOverlay
|
|
1124
|
-
item={entry}
|
|
1125
|
-
playerIsDocked={docked}
|
|
1126
|
-
pluginConfiguration={this.getPluginConfiguration()}
|
|
1127
|
-
playerId={this.props.playerId}
|
|
1128
|
-
playNextData={this.getPlayNextData()}
|
|
1129
|
-
setNextVideoPreloadThresholdPercentage={
|
|
1130
|
-
this.props.setNextVideoPreloadThresholdPercentage
|
|
1131
|
-
}
|
|
1132
|
-
/>
|
|
1133
|
-
)}
|
|
1134
|
-
</View>
|
|
1135
|
-
);
|
|
1136
|
-
}}
|
|
1137
|
-
</PlayerWrapper>
|
|
1112
|
+
)}
|
|
1113
|
+
</View>
|
|
1114
|
+
);
|
|
1115
|
+
}}
|
|
1116
|
+
/>
|
|
1117
|
+
}
|
|
1118
|
+
extraContent={
|
|
1119
|
+
<PlayerDetails
|
|
1120
|
+
configuration={this.getPluginConfiguration()}
|
|
1121
|
+
style={{ flex: 1 }}
|
|
1122
|
+
entry={entry}
|
|
1123
|
+
isTabletLandscape={!isTabletPortrait}
|
|
1124
|
+
inline={inline}
|
|
1125
|
+
docked={docked}
|
|
1126
|
+
isModal={isModal}
|
|
1127
|
+
pip={this.state.piped}
|
|
1128
|
+
/>
|
|
1129
|
+
}
|
|
1130
|
+
collapsedContent={
|
|
1131
|
+
<View style={styles.container}>
|
|
1132
|
+
<DockedControls
|
|
1133
|
+
entry={entry}
|
|
1134
|
+
aspectRatio={aspectRatio}
|
|
1135
|
+
layoutState={sharedWrapperViewProps.layoutState}
|
|
1136
|
+
playNextData={sharedWrapperViewProps.playNextData}
|
|
1137
|
+
/>
|
|
1138
|
+
</View>
|
|
1139
|
+
}
|
|
1140
|
+
/>
|
|
1138
1141
|
);
|
|
1139
1142
|
};
|
|
1140
1143
|
|
|
1141
1144
|
const renderTVPlayer = () => {
|
|
1142
1145
|
return (
|
|
1143
1146
|
<View style={this.takeParentStyle} testID={"player-view"}>
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
<this.props.PlayerComponent
|
|
1153
|
-
ref={this._assignRoot}
|
|
1154
|
-
{...nativeEvents}
|
|
1155
|
-
{...nativeProps}
|
|
1156
|
-
listener={this.props.listener}
|
|
1157
|
-
style={this.takeParentStyle}
|
|
1147
|
+
<TVPlayerView
|
|
1148
|
+
type={isAudioItem ? "audio" : "video"}
|
|
1149
|
+
entry={entry}
|
|
1150
|
+
inline={isInlineTV}
|
|
1151
|
+
transportControls={renderTransportControls(this.takeParentStyle)}
|
|
1152
|
+
PlayerComponent={this.props.PlayerComponent}
|
|
1153
|
+
nativePlayerIsReady={this.state.nativePlayerIsReady}
|
|
1158
1154
|
pluginConfiguration={this.getPluginConfiguration()}
|
|
1159
|
-
|
|
1155
|
+
playerProps={{
|
|
1156
|
+
ref: this._assignRoot,
|
|
1157
|
+
...nativeEvents,
|
|
1158
|
+
...nativeProps,
|
|
1159
|
+
listener: this.props.listener,
|
|
1160
|
+
style: this.takeParentStyle,
|
|
1161
|
+
controller: this.props.controller,
|
|
1162
|
+
}}
|
|
1163
|
+
audioPlayerProps={{ style: getStyle(styles.playerSize) }}
|
|
1164
|
+
playNextProps={{
|
|
1165
|
+
playerIsDocked: docked,
|
|
1166
|
+
playerId: this.props.playerId,
|
|
1167
|
+
playNextData: this.getPlayNextData(),
|
|
1168
|
+
setNextVideoPreloadThresholdPercentage:
|
|
1169
|
+
this.props.setNextVideoPreloadThresholdPercentage,
|
|
1170
|
+
}}
|
|
1160
1171
|
>
|
|
1161
|
-
{
|
|
1162
|
-
</
|
|
1163
|
-
|
|
1164
|
-
{renderTransportControls(this.takeParentStyle)}
|
|
1165
|
-
{!isTvOS && (
|
|
1166
|
-
<PlayNextOverlay
|
|
1167
|
-
item={entry}
|
|
1168
|
-
playerIsDocked={docked}
|
|
1169
|
-
pluginConfiguration={this.getPluginConfiguration()}
|
|
1170
|
-
playerId={this.props.playerId}
|
|
1171
|
-
playNextData={this.getPlayNextData()}
|
|
1172
|
-
setNextVideoPreloadThresholdPercentage={
|
|
1173
|
-
this.props.setNextVideoPreloadThresholdPercentage
|
|
1174
|
-
}
|
|
1175
|
-
/>
|
|
1176
|
-
)}
|
|
1172
|
+
{this.props.children}
|
|
1173
|
+
</TVPlayerView>
|
|
1177
1174
|
</View>
|
|
1178
1175
|
);
|
|
1179
1176
|
};
|
package/src/QuickBrickPlayer.tsx
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import { ZStoreProvider } from "@applicaster/zapp-react-native-utils/reactHooks/state";
|
|
2
3
|
|
|
3
4
|
import { useOrientationEffect } from "@applicaster/zapp-react-native-utils/reactHooks/videoModal";
|
|
4
5
|
import Player from "./Player";
|
|
5
6
|
import { useActions } from "@applicaster/zapp-react-native-utils/reactHooks/actions";
|
|
6
7
|
import { isWeb } from "@applicaster/zapp-react-native-utils/reactUtils";
|
|
7
8
|
import { useNavigation } from "@applicaster/zapp-react-native-utils/reactHooks";
|
|
9
|
+
import { usePlayerTTS } from "@applicaster/zapp-react-native-utils/playerUtils/usePlayerTTS";
|
|
8
10
|
import { useIsCasting } from "./Player/hooks/useIsCasting";
|
|
9
11
|
|
|
10
12
|
const CHROMECAST_IDENTIFIER = "quick-brick-chromecast-action";
|
|
@@ -45,17 +47,21 @@ const QuickBrickPlayerComponent = (
|
|
|
45
47
|
isRunningPlayNext: !!props?.playNextData,
|
|
46
48
|
});
|
|
47
49
|
|
|
50
|
+
usePlayerTTS();
|
|
51
|
+
|
|
48
52
|
return (
|
|
49
|
-
<
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
53
|
+
<ZStoreProvider name="playerConfiguration" value={controller?.config}>
|
|
54
|
+
<Player
|
|
55
|
+
{...props}
|
|
56
|
+
ref={ref}
|
|
57
|
+
castAction={!props?.disableCastAction && castAction}
|
|
58
|
+
isCasting={isCasting}
|
|
59
|
+
PlayerComponent={props.PlayerComponent}
|
|
60
|
+
openPiP={openPiP}
|
|
61
|
+
closePiP={closePiP}
|
|
62
|
+
mode={mode}
|
|
63
|
+
/>
|
|
64
|
+
</ZStoreProvider>
|
|
59
65
|
);
|
|
60
66
|
};
|
|
61
67
|
|
|
File without changes
|