@applicaster/quick-brick-player 12.0.0-alpha.3104484121 → 12.0.0-alpha.3425722002

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.3104484121",
3
+ "version": "12.0.0-alpha.3425722002",
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-alpha.3104484121",
39
+ "@applicaster/quick-brick-mobile-transport-controls": "12.0.0-rc.28",
40
40
  "@applicaster/quick-brick-tv-transport-controls": "11.0.0-rc.133",
41
- "@applicaster/zapp-react-native-tvos-app": "12.0.0-alpha.3104484121",
42
- "@applicaster/zapp-react-native-ui-components": "12.0.0-alpha.3104484121",
43
- "@applicaster/zapp-react-native-utils": "12.0.0-alpha.3104484121",
41
+ "@applicaster/zapp-react-native-tvos-app": "12.0.0-alpha.3425722002",
42
+ "@applicaster/zapp-react-native-ui-components": "12.0.0-alpha.3425722002",
43
+ "@applicaster/zapp-react-native-utils": "12.0.0-alpha.3425722002",
44
44
  "keymirror": "^0.1.1",
45
45
  "query-string": "7.1.3",
46
46
  "react-native-web-linear-gradient": "1.1.2",
@@ -1,8 +1,9 @@
1
1
  import React, { useEffect, useState } from "react";
2
- import { Image, StyleSheet, View } from "react-native";
2
+ import { StyleSheet, View } from "react-native";
3
3
  import { usePlayer } from "@applicaster/zapp-react-native-utils/appUtils/playerManager/usePlayer";
4
4
  import { MUTED_USAGE } from "../const";
5
5
  import { LiveImageManager } from "@applicaster/zapp-react-native-ui-components/Components/VideoLive/LiveImageManager";
6
+ import { QBImage as Image } from "@applicaster/zapp-react-native-ui-components/Components/Image";
6
7
 
7
8
  type Asset = string | undefined;
8
9
 
@@ -144,9 +144,9 @@ export const AudioPlayerWrapper: React.FC<Props> = (props: Props) => {
144
144
  const isTablet = useIsTablet();
145
145
 
146
146
  const isTabletLandscape = !isTV() && isTablet && !isTabletPortrait;
147
-
147
+
148
148
  // TODO: Have generic place for live url from configuration. Currently its hardcoded for client.
149
-
149
+
150
150
  const feedUrl = getLiveUrl(entry?.extensions?.live?.channel_src ?? "");
151
151
 
152
152
  const { title, summary } = useTitleSummaryOverlay(
@@ -36,6 +36,8 @@ 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 { getTargetScreenDataFromEntry } from "@applicaster/zapp-react-native-utils/reactHooks/screen/useTargetScreenData";
40
+ import { isAppleTV } from "@applicaster/zapp-react-native-ui-components/Helpers/Platform";
39
41
 
40
42
  const RNPlayerManager = {
41
43
  QuickBrickPlayerPlugin: isApplePlatform()
@@ -555,6 +557,26 @@ export default class VideoPlayer extends React.Component<
555
557
  this.props.listener?.onPlayerDetached?.(nativeEvent);
556
558
  };
557
559
 
560
+ onVideoFullscreenPlayerDidDismiss = () => {
561
+ this.props.listener?.onVideoFullscreenPlayerDidDismiss?.();
562
+ };
563
+
564
+ onVideoFullscreenPlayerDidPresent = () => {
565
+ this.props.listener?.onVideoFullscreenPlayerDidPresent?.();
566
+ };
567
+
568
+ onVideoFullscreenPlayerWillDismiss = () => {
569
+ this.props.listener?.onVideoFullscreenPlayerWillDismiss?.();
570
+ };
571
+
572
+ onVideoFullscreenPlayerWillPresent = () => {
573
+ this.props.listener?.onVideoFullscreenPlayerWillPresent?.();
574
+ };
575
+
576
+ onPlayerClose = () => {
577
+ this.props.listener?.onPlayerClose?.();
578
+ };
579
+
558
580
  onPiPEnter = () => {
559
581
  this.setState({ piped: true });
560
582
  this.props.openPiP();
@@ -759,7 +781,6 @@ export default class VideoPlayer extends React.Component<
759
781
  render() {
760
782
  const {
761
783
  castAction,
762
- controls,
763
784
  docked,
764
785
  entry,
765
786
  fullscreen,
@@ -817,17 +838,32 @@ export default class VideoPlayer extends React.Component<
817
838
  const liveCatchUpEnabled =
818
839
  this.props.pluginConfiguration?.liveCatchUpEnabled;
819
840
 
820
- const hideNativeControls = isTV()
821
- ? { controls: !this.getPlayNextData() }
822
- : {};
841
+ // TODO: Get screen data more reliable way useCurrentScreenData
842
+ const screenData = getTargetScreenDataFromEntry(this.props.playableItem);
823
843
 
824
- const platformSpecificProps = isApplePlatform()
844
+ const isInlineTV = screenData?.ui_components?.length > 0 && isTV();
845
+
846
+ let platformSpecificProps: any = isApplePlatform()
825
847
  ? {
826
- ...hideNativeControls,
827
848
  resizeMode: nativeResizeMode,
828
849
  }
829
850
  : {};
830
851
 
852
+ const supportsNativeControls =
853
+ !!this.props.controller?.supportsNativeControls?.();
854
+
855
+ const controls = isAppleTV()
856
+ ? supportsNativeControls && isInlineTV && !this.getPlayNextData()
857
+ : supportsNativeControls && !this.getPlayNextData();
858
+
859
+ const shouldUseNativeControls =
860
+ controls && supportsNativeControls && !docked;
861
+
862
+ platformSpecificProps = {
863
+ ...platformSpecificProps,
864
+ controls: shouldUseNativeControls,
865
+ };
866
+
831
867
  const pictureInPictureEnabled =
832
868
  this.props.pluginConfiguration?.pictureInPictureEnabled;
833
869
 
@@ -835,7 +871,6 @@ export default class VideoPlayer extends React.Component<
835
871
  entry, // Must be passed first in list
836
872
  ...platformSpecificProps,
837
873
  audioTrackId,
838
- controls,
839
874
  docked,
840
875
  enableAutoAudioTrackSelection,
841
876
  fullscreen, // TODO: Check fullscreen params not crash
@@ -890,22 +925,17 @@ export default class VideoPlayer extends React.Component<
890
925
  onVideoEnd: this.onVideoEnd, // complete
891
926
  onVideoError: this.onVideoError, // error
892
927
  onVideoProgress: this.onVideoProgress,
893
- onVideoFullscreenPlayerDidDismiss: this.unHandledEvent(
894
- "onVideoFullscreenPlayerDidPresent"
895
- ),
896
- onVideoFullscreenPlayerDidPresent: this.unHandledEvent(
897
- "onVideoFullscreenPlayerDidPresent"
898
- ),
899
- onVideoFullscreenPlayerWillDismiss: this.unHandledEvent(
900
- "onVideoFullscreenPlayerWillDismiss"
901
- ),
902
- onVideoFullscreenPlayerWillPresent: this.unHandledEvent(
903
- "onVideoFullscreenPlayerWillPresent"
904
- ),
928
+ onVideoFullscreenPlayerDidDismiss: this.onVideoFullscreenPlayerDidDismiss,
929
+ onVideoFullscreenPlayerDidPresent: this.onVideoFullscreenPlayerDidPresent,
930
+ onVideoFullscreenPlayerWillDismiss:
931
+ this.onVideoFullscreenPlayerWillDismiss,
932
+ onVideoFullscreenPlayerWillPresent:
933
+ this.onVideoFullscreenPlayerWillPresent,
905
934
  onVideoLoad: this.onVideoLoad,
906
935
  onVideoLoadStart: this.unHandledEvent("onVideoLoadStart"),
907
936
  onVideoBuffer: this.onVideoBuffer,
908
937
  onPlaybackStalled: this.onPlaybackStalled,
938
+ onPlayerClose: this.onPlayerClose,
909
939
  onPlayerAttached: this.onPlayerAttached,
910
940
  onPlayerDetached: this.onPlayerDetached,
911
941
  };
@@ -979,7 +1009,7 @@ export default class VideoPlayer extends React.Component<
979
1009
  !needToShowPlayNextOverlay &&
980
1010
  this.props.mode !== "PIP";
981
1011
 
982
- if (controls === true) {
1012
+ if (shouldUseNativeControls) {
983
1013
  return null;
984
1014
  }
985
1015