@applicaster/quick-brick-player 14.0.0-rc.8 → 15.0.0-alpha.1456157166
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 +181 -188
- 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,21 @@ 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
|
+
|
|
49
54
|
const styles = StyleSheet.create({
|
|
50
55
|
container: { flex: 1 },
|
|
51
56
|
playerContainerBlack: { backgroundColor: DEFAULT_COLORS.black },
|
|
@@ -55,8 +60,8 @@ const styles = StyleSheet.create({
|
|
|
55
60
|
position: "absolute",
|
|
56
61
|
zIndex: 1,
|
|
57
62
|
},
|
|
58
|
-
audioPlayerSize: { width: "100%", height: "100%" },
|
|
59
63
|
playerSize: { width: "100%", height: "100%" },
|
|
64
|
+
flexImage: { height: "100%", aspectRatio: 1, flex: -1 },
|
|
60
65
|
});
|
|
61
66
|
|
|
62
67
|
const logger = createLogger({
|
|
@@ -66,7 +71,14 @@ const logger = createLogger({
|
|
|
66
71
|
|
|
67
72
|
const isTvOS = isTvOSPlatform();
|
|
68
73
|
|
|
69
|
-
const
|
|
74
|
+
const { width: SCREEN_WIDTH, height: SCREEN_HEIGHT } = Dimensions.get("screen");
|
|
75
|
+
|
|
76
|
+
const getScreenAspectRatio = () => {
|
|
77
|
+
const longEdge = Math.max(SCREEN_WIDTH, SCREEN_HEIGHT);
|
|
78
|
+
const shortEdge = Math.min(SCREEN_WIDTH, SCREEN_HEIGHT);
|
|
79
|
+
|
|
80
|
+
return longEdge / shortEdge;
|
|
81
|
+
};
|
|
70
82
|
|
|
71
83
|
export default class VideoPlayer extends React.Component<
|
|
72
84
|
QuickBrickPlayer.PlayerProps,
|
|
@@ -688,53 +700,6 @@ export default class VideoPlayer extends React.Component<
|
|
|
688
700
|
}
|
|
689
701
|
};
|
|
690
702
|
|
|
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
703
|
get supportNativeCast() {
|
|
739
704
|
return this.props.controller.supportNativeCast();
|
|
740
705
|
}
|
|
@@ -828,7 +793,7 @@ export default class VideoPlayer extends React.Component<
|
|
|
828
793
|
};
|
|
829
794
|
|
|
830
795
|
const isFullScreenAudioPlayer =
|
|
831
|
-
this.getPluginConfiguration()?.
|
|
796
|
+
this.getPluginConfiguration()?.full_screen_audio_player || false;
|
|
832
797
|
|
|
833
798
|
const isAudioPlayer = isFullScreenAudioPlayer && isAudioItem;
|
|
834
799
|
|
|
@@ -870,7 +835,7 @@ export default class VideoPlayer extends React.Component<
|
|
|
870
835
|
this.isReactNativeMethodsSupported() &&
|
|
871
836
|
RNPlayerManager?.[this.playerPluginId]?.play
|
|
872
837
|
) {
|
|
873
|
-
delete nativeProps
|
|
838
|
+
delete nativeProps.paused;
|
|
874
839
|
}
|
|
875
840
|
|
|
876
841
|
const adEvents = {
|
|
@@ -1021,159 +986,187 @@ export default class VideoPlayer extends React.Component<
|
|
|
1021
986
|
pip: this.state.piped,
|
|
1022
987
|
},
|
|
1023
988
|
configuration: this.getPluginConfiguration(),
|
|
1024
|
-
|
|
1025
|
-
isTabletPortrait: isTabletPortrait,
|
|
989
|
+
isTabletPortrait,
|
|
1026
990
|
playNextData: this.getPlayNextData(),
|
|
1027
991
|
};
|
|
1028
992
|
|
|
1029
|
-
const containerStyle = { flex: 1 };
|
|
1030
|
-
|
|
1031
993
|
const backgroundImageKey =
|
|
1032
994
|
this.getPluginConfiguration()?.player_preview_image_key;
|
|
1033
995
|
|
|
1034
996
|
const shouldRenderNativePlayer =
|
|
1035
997
|
!this.props.isCasting || this.supportNativeCast;
|
|
1036
998
|
|
|
999
|
+
const aspectRatio =
|
|
1000
|
+
!inline && isModal && !this.state.piped ? getScreenAspectRatio() : 16 / 9;
|
|
1001
|
+
|
|
1037
1002
|
const renderMobilePlayer = () => {
|
|
1038
1003
|
return isFullScreenAudioPlayer && isAudioItem ? (
|
|
1039
1004
|
// Ensure the View remains in the native hierarchy for proper rendering and interaction
|
|
1040
|
-
<
|
|
1041
|
-
{
|
|
1042
|
-
<
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1005
|
+
<PlayerModal
|
|
1006
|
+
content={
|
|
1007
|
+
<View collapsable={false} style={styles.container}>
|
|
1008
|
+
{shouldRenderNativePlayer ? (
|
|
1009
|
+
<this.props.PlayerComponent
|
|
1010
|
+
ref={this._assignRoot}
|
|
1011
|
+
{...nativeEvents}
|
|
1012
|
+
{...nativeProps}
|
|
1013
|
+
listener={this.props.listener}
|
|
1014
|
+
/>
|
|
1015
|
+
) : null}
|
|
1016
|
+
<AudioPlayerWrapper {...sharedWrapperViewProps} />
|
|
1017
|
+
</View>
|
|
1018
|
+
}
|
|
1019
|
+
collapsedContent={
|
|
1020
|
+
<View style={styles.container}>
|
|
1021
|
+
<DockedControls
|
|
1022
|
+
entry={entry}
|
|
1023
|
+
aspectRatio={1}
|
|
1024
|
+
layoutState={sharedWrapperViewProps.layoutState}
|
|
1025
|
+
playNextData={sharedWrapperViewProps.playNextData}
|
|
1026
|
+
ImageComponent={
|
|
1027
|
+
<FlexImage entry={entry} style={styles.flexImage} />
|
|
1028
|
+
}
|
|
1029
|
+
/>
|
|
1030
|
+
</View>
|
|
1031
|
+
}
|
|
1032
|
+
/>
|
|
1051
1033
|
) : (
|
|
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
|
-
|
|
1034
|
+
<VideoPlayerModal
|
|
1035
|
+
isTabletPortrait={isTabletPortrait}
|
|
1036
|
+
aspectRatio={aspectRatio}
|
|
1037
|
+
pip={this.state.piped}
|
|
1038
|
+
fullscreen={fullscreen}
|
|
1039
|
+
modal={isModal}
|
|
1040
|
+
style={{
|
|
1041
|
+
tabletLandscapeWidth: getTabletWidth(
|
|
1042
|
+
this.getPluginConfiguration().tablet_landscape_sidebar_width,
|
|
1043
|
+
style
|
|
1044
|
+
),
|
|
1045
|
+
width: style.width,
|
|
1046
|
+
height: style.height,
|
|
1047
|
+
}}
|
|
1048
|
+
content={
|
|
1049
|
+
<PlayerWrapper
|
|
1050
|
+
{...sharedWrapperViewProps}
|
|
1051
|
+
// eslint-disable-next-line react/no-unstable-nested-components
|
|
1052
|
+
playerContent={(playerDimensions) => {
|
|
1053
|
+
const shouldRenderBackground =
|
|
1054
|
+
!R.isNil(backgroundImageKey) &&
|
|
1055
|
+
backgroundImageKey.length > 0 &&
|
|
1056
|
+
!this.onVideoLoadCalled &&
|
|
1057
|
+
!this.state.isAd;
|
|
1058
|
+
|
|
1059
|
+
return (
|
|
1060
|
+
<View style={styles.container}>
|
|
1061
|
+
<View style={[playerContainerStyles, playerDimensions]}>
|
|
1062
|
+
{isAudioItem ? (
|
|
1063
|
+
<AudioPlayer
|
|
1064
|
+
style={styles.playerSize}
|
|
1065
|
+
audio_item={entry}
|
|
1066
|
+
plugin_configuration={this.getPluginConfiguration()}
|
|
1067
|
+
/>
|
|
1068
|
+
) : null}
|
|
1069
|
+
|
|
1070
|
+
{shouldRenderBackground ? (
|
|
1071
|
+
<PlayerImageBackground
|
|
1072
|
+
imageKey={backgroundImageKey}
|
|
1073
|
+
configuration={this.getPluginConfiguration()}
|
|
1074
|
+
entry={entry}
|
|
1075
|
+
style={getBackgroundImageStyle(playerDimensions)}
|
|
1076
|
+
/>
|
|
1077
|
+
) : null}
|
|
1078
|
+
|
|
1079
|
+
{shouldRenderNativePlayer ? (
|
|
1080
|
+
<View style={getStyle(playerDimensions)}>
|
|
1081
|
+
<this.props.PlayerComponent
|
|
1082
|
+
ref={this._assignRoot}
|
|
1083
|
+
{...nativeEvents}
|
|
1084
|
+
{...nativeProps}
|
|
1085
|
+
listener={this.props.listener}
|
|
1086
|
+
style={styles.playerSize}
|
|
1087
|
+
pluginConfiguration={this.getPluginConfiguration()}
|
|
1088
|
+
controller={this.props.controller}
|
|
1089
|
+
>
|
|
1090
|
+
{this.props.children}
|
|
1091
|
+
</this.props.PlayerComponent>
|
|
1092
|
+
</View>
|
|
1093
|
+
) : null}
|
|
1094
|
+
</View>
|
|
1095
|
+
|
|
1096
|
+
{renderTransportControls(playerDimensions)}
|
|
1097
|
+
{!this.state.piped && (
|
|
1098
|
+
<PlayNextOverlay
|
|
1099
|
+
item={entry}
|
|
1100
|
+
playerIsDocked={docked}
|
|
1101
|
+
pluginConfiguration={this.getPluginConfiguration()}
|
|
1102
|
+
playerId={this.props.playerId}
|
|
1103
|
+
playNextData={this.getPlayNextData()}
|
|
1104
|
+
setNextVideoPreloadThresholdPercentage={
|
|
1105
|
+
this.props.setNextVideoPreloadThresholdPercentage
|
|
1077
1106
|
}
|
|
1078
|
-
audio_item={entry}
|
|
1079
|
-
plugin_configuration={this.getPluginConfiguration()}
|
|
1080
1107
|
/>
|
|
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>
|
|
1108
|
+
)}
|
|
1109
|
+
</View>
|
|
1110
|
+
);
|
|
1111
|
+
}}
|
|
1112
|
+
/>
|
|
1113
|
+
}
|
|
1114
|
+
extraContent={
|
|
1115
|
+
<PlayerDetails
|
|
1116
|
+
configuration={this.getPluginConfiguration()}
|
|
1117
|
+
style={{ flex: 1 }}
|
|
1118
|
+
entry={entry}
|
|
1119
|
+
isTabletLandscape={!isTabletPortrait}
|
|
1120
|
+
inline={inline}
|
|
1121
|
+
docked={docked}
|
|
1122
|
+
isModal={isModal}
|
|
1123
|
+
pip={this.state.piped}
|
|
1124
|
+
/>
|
|
1125
|
+
}
|
|
1126
|
+
collapsedContent={
|
|
1127
|
+
<View style={styles.container}>
|
|
1128
|
+
<DockedControls
|
|
1129
|
+
entry={entry}
|
|
1130
|
+
aspectRatio={aspectRatio}
|
|
1131
|
+
layoutState={sharedWrapperViewProps.layoutState}
|
|
1132
|
+
playNextData={sharedWrapperViewProps.playNextData}
|
|
1133
|
+
/>
|
|
1134
|
+
</View>
|
|
1135
|
+
}
|
|
1136
|
+
/>
|
|
1138
1137
|
);
|
|
1139
1138
|
};
|
|
1140
1139
|
|
|
1141
1140
|
const renderTVPlayer = () => {
|
|
1142
1141
|
return (
|
|
1143
1142
|
<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}
|
|
1143
|
+
<TVPlayerView
|
|
1144
|
+
type={isAudioItem ? "audio" : "video"}
|
|
1145
|
+
entry={entry}
|
|
1146
|
+
inline={isInlineTV}
|
|
1147
|
+
transportControls={renderTransportControls(this.takeParentStyle)}
|
|
1148
|
+
PlayerComponent={this.props.PlayerComponent}
|
|
1149
|
+
nativePlayerIsReady={this.state.nativePlayerIsReady}
|
|
1158
1150
|
pluginConfiguration={this.getPluginConfiguration()}
|
|
1159
|
-
|
|
1151
|
+
playerProps={{
|
|
1152
|
+
ref: this._assignRoot,
|
|
1153
|
+
...nativeEvents,
|
|
1154
|
+
...nativeProps,
|
|
1155
|
+
listener: this.props.listener,
|
|
1156
|
+
style: this.takeParentStyle,
|
|
1157
|
+
controller: this.props.controller,
|
|
1158
|
+
}}
|
|
1159
|
+
audioPlayerProps={{ style: getStyle(styles.playerSize) }}
|
|
1160
|
+
playNextProps={{
|
|
1161
|
+
playerIsDocked: docked,
|
|
1162
|
+
playerId: this.props.playerId,
|
|
1163
|
+
playNextData: this.getPlayNextData(),
|
|
1164
|
+
setNextVideoPreloadThresholdPercentage:
|
|
1165
|
+
this.props.setNextVideoPreloadThresholdPercentage,
|
|
1166
|
+
}}
|
|
1160
1167
|
>
|
|
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
|
-
)}
|
|
1168
|
+
{this.props.children}
|
|
1169
|
+
</TVPlayerView>
|
|
1177
1170
|
</View>
|
|
1178
1171
|
);
|
|
1179
1172
|
};
|
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
|