@applicaster/quick-brick-player 13.0.6-alpha.4390983410 → 14.0.0-alpha.1015356256

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": "13.0.6-alpha.4390983410",
3
+ "version": "14.0.0-alpha.1015356256",
4
4
  "description": "Quick Brick Player",
5
5
  "main": "./src/index.ts",
6
6
  "types": "index.d.ts",
@@ -35,13 +35,12 @@
35
35
  },
36
36
  "homepage": "https://github.com/applicaster/quickbrick#readme",
37
37
  "dependencies": {
38
- "@applicaster/quick-brick-mobile-transport-controls": "13.0.6-alpha.4390983410",
39
- "@applicaster/quick-brick-tv-transport-controls": "13.0.6-alpha.4390983410",
40
- "@applicaster/zapp-react-native-tvos-app": "13.0.6-alpha.4390983410",
41
- "@applicaster/zapp-react-native-ui-components": "13.0.6-alpha.4390983410",
42
- "@applicaster/zapp-react-native-utils": "13.0.6-alpha.4390983410",
38
+ "@applicaster/quick-brick-mobile-transport-controls": "14.0.0-rc.34",
39
+ "@applicaster/quick-brick-tv-transport-controls": "14.0.0-alpha.1015356256",
40
+ "@applicaster/zapp-react-native-tvos-app": "14.0.0-alpha.1015356256",
41
+ "@applicaster/zapp-react-native-ui-components": "14.0.0-alpha.1015356256",
42
+ "@applicaster/zapp-react-native-utils": "14.0.0-alpha.1015356256",
43
43
  "query-string": "7.1.3",
44
- "react-native-web-linear-gradient": "1.1.2",
45
44
  "shaka-player": "4.3.5",
46
45
  "typeface-montserrat": "^0.0.54",
47
46
  "video.js": "7.14.3",
@@ -62,11 +61,9 @@
62
61
  "react": "*",
63
62
  "react-native": "*",
64
63
  "react-native-fs": "*",
65
- "react-native-gesture-handler": "*",
66
64
  "react-native-linear-gradient": "*",
67
65
  "react-native-safe-area-context": "*",
68
66
  "react-native-svg": "*",
69
- "react-native-web": "*",
70
67
  "react-native-webview": "*",
71
68
  "uglify-js": "*",
72
69
  "validate-color": "*",
@@ -16,7 +16,7 @@ import {
16
16
  BottomDebugSquare,
17
17
  LeftDebugSquare,
18
18
  RightDebugSquare,
19
- } from "./Debug/index";
19
+ } from "./DebugComponent";
20
20
 
21
21
  import { Props } from "./types";
22
22
 
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  import { ModalHeader } from "@applicaster/zapp-react-native-ui-components/Components/ModalComponent/Header";
3
- import { isNil } from "lodash";
3
+ import { isNil } from "@applicaster/zapp-react-native-utils/utils";
4
4
 
5
5
  const formatTime = (milliseconds: number) => {
6
6
  const totalSeconds = Math.floor(milliseconds / 1000);
@@ -0,0 +1,42 @@
1
+ import React from "react";
2
+ import { PlayNextOverlay } from "../PlayNextOverlay";
3
+ import { GenericTVPlayerViewProps } from "./types";
4
+ import { AudioPlayer } from "@applicaster/zapp-react-native-ui-components/Components/AudioPlayer";
5
+
6
+ export const GenericTVPlayerView: React.FC<GenericTVPlayerViewProps> = ({
7
+ children,
8
+ type,
9
+ PlayerComponent,
10
+ pluginConfiguration,
11
+ playerProps,
12
+ playNextProps,
13
+ audioPlayerProps,
14
+ transportControls,
15
+ entry,
16
+ }) => {
17
+ return (
18
+ <>
19
+ {type === "audio" ? (
20
+ <AudioPlayer
21
+ audio_item={entry}
22
+ plugin_configuration={pluginConfiguration}
23
+ {...audioPlayerProps}
24
+ />
25
+ ) : null}
26
+ <PlayerComponent
27
+ pluginConfiguration={pluginConfiguration}
28
+ {...playerProps}
29
+ >
30
+ {children}
31
+ </PlayerComponent>
32
+ {transportControls}
33
+ {playNextProps.playNextData ? (
34
+ <PlayNextOverlay
35
+ item={entry}
36
+ pluginConfiguration={pluginConfiguration}
37
+ {...playNextProps}
38
+ />
39
+ ) : null}
40
+ </>
41
+ );
42
+ };
@@ -0,0 +1,26 @@
1
+ import React from "react";
2
+ import { isTvOSPlatform } from "@applicaster/zapp-react-native-utils/reactUtils";
3
+ import { TvOSPlayerView } from "./TvOSPlayerView";
4
+ import { GenericTVPlayerView } from "./GenericTVPlayerView";
5
+ import {
6
+ GenericTVPlayerViewProps,
7
+ TvOSPlayerViewProps,
8
+ TVPlayerViewProps,
9
+ } from "./types";
10
+
11
+ const isTvOS = isTvOSPlatform();
12
+
13
+ const shouldRenderTvOSPlayerView = (
14
+ isTvOS: boolean,
15
+ inline: boolean
16
+ ): boolean => {
17
+ return isTvOS && !inline;
18
+ };
19
+
20
+ export const TVPlayerView: React.FC<TVPlayerViewProps> = (props) => {
21
+ return shouldRenderTvOSPlayerView(isTvOS, props.inline) ? (
22
+ <TvOSPlayerView {...(props as TvOSPlayerViewProps)} />
23
+ ) : (
24
+ <GenericTVPlayerView {...(props as GenericTVPlayerViewProps)} />
25
+ );
26
+ };
@@ -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;
@@ -46,6 +46,7 @@ import {
46
46
  isInlineTV as isInlineTVUtil,
47
47
  } from "@applicaster/zapp-react-native-utils/playerUtils";
48
48
 
49
+ import { TVPlayerView } from "./PlayerView/TVPlayerView";
49
50
  import PlayerModal, { VideoPlayerModal } from "./PlayerModal";
50
51
  import { DockedControls } from "./AudioLayer/Layout/DockedControls";
51
52
  import { FlexImage } from "./AudioLayer/Layout/PlayerImage/FlexImage";
@@ -59,7 +60,6 @@ const styles = StyleSheet.create({
59
60
  position: "absolute",
60
61
  zIndex: 1,
61
62
  },
62
- audioPlayerSize: { width: "100%", height: "100%" },
63
63
  playerSize: { width: "100%", height: "100%" },
64
64
  flexImage: { height: "100%", aspectRatio: 1, flex: -1 },
65
65
  });
@@ -71,8 +71,6 @@ const logger = createLogger({
71
71
 
72
72
  const isTvOS = isTvOSPlatform();
73
73
 
74
- const AUDIO_PLAYER_NATIVE_ID = "audio-player-view";
75
-
76
74
  const { width: SCREEN_WIDTH, height: SCREEN_HEIGHT } = Dimensions.get("screen");
77
75
 
78
76
  const getScreenAspectRatio = () => {
@@ -702,53 +700,6 @@ export default class VideoPlayer extends React.Component<
702
700
  }
703
701
  };
704
702
 
705
- childrenWithExtensions = () => {
706
- const { docked, entry, children } = this.props;
707
-
708
- if (!isTvOS) {
709
- return children;
710
- }
711
-
712
- const output = [];
713
-
714
- // audio-player
715
- if (isAudioItemUtil(entry)) {
716
- const { nativePlayerIsReady } = this.state;
717
-
718
- // we have to wait ready status of native player view, before showing audio_player
719
- if (nativePlayerIsReady) {
720
- output.push(
721
- <View nativeID={AUDIO_PLAYER_NATIVE_ID} key={AUDIO_PLAYER_NATIVE_ID}>
722
- {children}
723
- </View>
724
- );
725
- }
726
- } else {
727
- output.push(children);
728
- }
729
- // audio-player
730
-
731
- // play-next
732
- if (this.getPlayNextData()) {
733
- output.push(
734
- <PlayNextOverlay
735
- key="play-next-overlay"
736
- item={entry}
737
- playerIsDocked={docked}
738
- pluginConfiguration={this.getPluginConfiguration()}
739
- playerId={this.props.playerId}
740
- playNextData={this.getPlayNextData()}
741
- setNextVideoPreloadThresholdPercentage={
742
- this.props.setNextVideoPreloadThresholdPercentage
743
- }
744
- />
745
- );
746
- }
747
- // play-next
748
-
749
- return flatten(output); // prevent possible case with nested array
750
- };
751
-
752
703
  get supportNativeCast() {
753
704
  return this.props.controller.supportNativeCast();
754
705
  }
@@ -1197,39 +1148,33 @@ export default class VideoPlayer extends React.Component<
1197
1148
  const renderTVPlayer = () => {
1198
1149
  return (
1199
1150
  <View style={this.takeParentStyle} testID={"player-view"}>
1200
- {isAudioItem && (isInlineTV || !isTvOS) ? (
1201
- <AudioPlayer
1202
- style={getStyle(styles.audioPlayerSize)}
1203
- audio_item={entry}
1204
- plugin_configuration={this.getPluginConfiguration()}
1205
- />
1206
- ) : null}
1207
-
1208
- <this.props.PlayerComponent
1209
- ref={this._assignRoot}
1210
- {...nativeEvents}
1211
- {...nativeProps}
1212
- listener={this.props.listener}
1213
- style={this.takeParentStyle}
1151
+ <TVPlayerView
1152
+ type={isAudioItem ? "audio" : "video"}
1153
+ entry={entry}
1154
+ inline={isInlineTV}
1155
+ transportControls={renderTransportControls(this.takeParentStyle)}
1156
+ PlayerComponent={this.props.PlayerComponent}
1157
+ nativePlayerIsReady={this.state.nativePlayerIsReady}
1214
1158
  pluginConfiguration={this.getPluginConfiguration()}
1215
- controller={this.props.controller}
1159
+ playerProps={{
1160
+ ref: this._assignRoot,
1161
+ ...nativeEvents,
1162
+ ...nativeProps,
1163
+ listener: this.props.listener,
1164
+ style: this.takeParentStyle,
1165
+ controller: this.props.controller,
1166
+ }}
1167
+ audioPlayerProps={{ style: getStyle(styles.playerSize) }}
1168
+ playNextProps={{
1169
+ playerIsDocked: docked,
1170
+ playerId: this.props.playerId,
1171
+ playNextData: this.getPlayNextData(),
1172
+ setNextVideoPreloadThresholdPercentage:
1173
+ this.props.setNextVideoPreloadThresholdPercentage,
1174
+ }}
1216
1175
  >
1217
- {!isInlineTV && this.childrenWithExtensions()}
1218
- </this.props.PlayerComponent>
1219
-
1220
- {renderTransportControls(this.takeParentStyle)}
1221
- {!isTvOS && (
1222
- <PlayNextOverlay
1223
- item={entry}
1224
- playerIsDocked={docked}
1225
- pluginConfiguration={this.getPluginConfiguration()}
1226
- playerId={this.props.playerId}
1227
- playNextData={this.getPlayNextData()}
1228
- setNextVideoPreloadThresholdPercentage={
1229
- this.props.setNextVideoPreloadThresholdPercentage
1230
- }
1231
- />
1232
- )}
1176
+ {this.props.children}
1177
+ </TVPlayerView>
1233
1178
  </View>
1234
1179
  );
1235
1180
  };