@applicaster/quick-brick-player 13.0.0-alpha.1724095599 → 13.0.0-alpha.1753452014

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.0-alpha.1724095599",
3
+ "version": "13.0.0-alpha.1753452014",
4
4
  "description": "Quick Brick Player",
5
5
  "main": "./src/index.ts",
6
6
  "types": "index.d.ts",
@@ -36,13 +36,14 @@
36
36
  },
37
37
  "homepage": "https://github.com/applicaster/quickbrick#readme",
38
38
  "dependencies": {
39
- "@applicaster/quick-brick-mobile-transport-controls": "13.0.0-rc.46",
40
- "@applicaster/quick-brick-tv-transport-controls": "13.0.0-alpha.1724095599",
41
- "@applicaster/zapp-react-native-tvos-app": "13.0.0-alpha.1724095599",
42
- "@applicaster/zapp-react-native-ui-components": "13.0.0-alpha.1724095599",
43
- "@applicaster/zapp-react-native-utils": "13.0.0-alpha.1724095599",
39
+ "@applicaster/quick-brick-mobile-transport-controls": "13.0.0-rc.55",
40
+ "@applicaster/quick-brick-tv-transport-controls": "13.0.0-rc.56",
41
+ "@applicaster/zapp-react-native-tvos-app": "13.0.0-alpha.1753452014",
42
+ "@applicaster/zapp-react-native-ui-components": "13.0.0-alpha.1753452014",
43
+ "@applicaster/zapp-react-native-utils": "13.0.0-alpha.1753452014",
44
44
  "keymirror": "^0.1.1",
45
45
  "query-string": "7.1.3",
46
+ "react-native-web-linear-gradient": "1.1.2",
46
47
  "shaka-player": "4.3.5",
47
48
  "typeface-montserrat": "^0.0.54",
48
49
  "video.js": "7.14.3",
@@ -60,15 +61,15 @@
60
61
  "@applicaster/zapp-react-native-tvos-ui-components": "*",
61
62
  "@babel/runtime": "*",
62
63
  "@react-native-community/netinfo": "*",
63
- "@types/node": "*",
64
- "@types/react-native": "0.69.6",
65
64
  "immer": "*",
66
65
  "react": "*",
67
66
  "react-native": "*",
68
67
  "react-native-fs": "*",
68
+ "react-native-gesture-handler": "*",
69
69
  "react-native-linear-gradient": "*",
70
70
  "react-native-safe-area-context": "*",
71
71
  "react-native-svg": "*",
72
+ "react-native-web": "*",
72
73
  "react-native-webview": "*",
73
74
  "uglify-js": "*",
74
75
  "validate-color": "*",
@@ -55,6 +55,11 @@ const useMuteUnmuteListeners = (playerId, player, asset, setImageUri) =>
55
55
  return;
56
56
  }
57
57
 
58
+ // initial state setup - show correct mute/unmute icon based on current state
59
+ if (player?.playerState?.isReadyToPlay) {
60
+ setImageUri(player.getIsMuted() ? asset.active : asset.inactive);
61
+ }
62
+
58
63
  // active action = muted, inactive = unmuted
59
64
  return player.addListener({
60
65
  id: liveImageButtonsListenerKey,
@@ -73,10 +78,17 @@ const useMuteUnmuteListeners = (playerId, player, asset, setImageUri) =>
73
78
  setImageUri(player?.getIsMuted() ? asset.active : asset.inactive);
74
79
  },
75
80
  onPlayerClose: () => {
76
- setImageUri(null);
81
+ if (isCurrentPlayer(playerId)) {
82
+ setImageUri(null);
83
+ }
77
84
  },
78
85
  onVideoEnd: () => {
79
- setImageUri(null);
86
+ if (isCurrentPlayer(playerId)) {
87
+ setImageUri(null);
88
+ }
89
+ },
90
+ onPlayerResume: () => {
91
+ setImageUri(player?.getIsMuted() ? asset.active : asset.inactive);
80
92
  },
81
93
  },
82
94
  });
@@ -93,7 +105,7 @@ const styles = StyleSheet.create({
93
105
  },
94
106
  });
95
107
 
96
- export function AssetComponent(props: CellActionAssetComponentProps) {
108
+ function AssetImage(props: CellActionAssetComponentProps) {
97
109
  const { cellUUID: playerId, asset } = props;
98
110
  const [imageUri, setImageUri] = useState<Asset>(null);
99
111
 
@@ -108,3 +120,5 @@ export function AssetComponent(props: CellActionAssetComponentProps) {
108
120
 
109
121
  return <View />;
110
122
  }
123
+
124
+ export const AssetComponent = React.memo(AssetImage);
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import { ViewStyle, View } from "react-native";
2
+ import { ViewStyle, View, Dimensions as ScreenDimensions } from "react-native";
3
3
 
4
4
  import { SafeAreaView, Edge } from "react-native-safe-area-context";
5
5
  import { usePlayerState } from "@applicaster/zapp-react-native-utils/appUtils/playerManager/usePlayerState";
@@ -40,6 +40,7 @@ import {
40
40
  SLEEP_TIMER_OFF,
41
41
  } from "./SleepTimerManager";
42
42
  import { SpeedController, PlaybackSpeed, DEFAULT_SPEED } from "./SpeedManager";
43
+ import { imageSrcFromMediaItem } from "@applicaster/zapp-react-native-utils/configurationUtils";
43
44
 
44
45
  const { log_debug } = createLogger({
45
46
  subsystem: "UIComponent",
@@ -78,8 +79,7 @@ type Props = {
78
79
  isTabletPortrait?: boolean;
79
80
  };
80
81
 
81
- export const defaultAspectRatioWidth = (height: number): number =>
82
- (height / 9) * 16;
82
+ const { width: SCREEN_WIDTH } = ScreenDimensions.get("screen");
83
83
 
84
84
  const Styles = {
85
85
  mainContainer: (style: ViewStyle) => {
@@ -105,7 +105,11 @@ const Styles = {
105
105
  height: 96,
106
106
  marginHorizontal: 24,
107
107
  },
108
- playerDetails: { marginTop: 60 },
108
+ playerDetails: {
109
+ marginTop: 60,
110
+ alignSelf: "center",
111
+ width: SCREEN_WIDTH - PADDING_HORIZONTAL * 2,
112
+ },
109
113
 
110
114
  linearGradient: {
111
115
  flex: 1,
@@ -442,7 +446,7 @@ export const AudioPlayerWrapper: React.FC<Props> = (props: Props) => {
442
446
  ]);
443
447
 
444
448
  if (configuration.magic_background) {
445
- const baseUrl = entry?.extensions?.audio_player_background_image ?? "";
449
+ const baseUrl = imageSrcFromMediaItem(entry, null);
446
450
 
447
451
  const queryParamName =
448
452
  configuration.audio_player_background_image_query || "width";
@@ -375,6 +375,7 @@ export default function DefaultLayout(props: LayoutProps) {
375
375
  >
376
376
  <PlayerImageBackground
377
377
  entry={entry}
378
+ docked={docked}
378
379
  style={Styles.backgroundImageContainer(dimensions, isTablet)}
379
380
  imageStyle={Styles.backgroundImageContainerImageStyle(
380
381
  isTablet,
@@ -408,6 +409,7 @@ export default function DefaultLayout(props: LayoutProps) {
408
409
  {needsToShowProgressBar ? (
409
410
  <View>
410
411
  <ProgressBar
412
+ name={"audio-default-layout"}
411
413
  content={entry}
412
414
  value={value}
413
415
  visible={true}
@@ -247,6 +247,7 @@ export default function DockedLayout(props: LayoutProps) {
247
247
  {!playerState.isLive &&
248
248
  (layoutState.docked || startComponentsAnimation) ? (
249
249
  <ProgressBar
250
+ name={"audio-docked-layout"}
250
251
  content={entry}
251
252
  value={value}
252
253
  visible={visible}
@@ -721,7 +721,7 @@ export default class VideoPlayer extends React.Component<
721
721
 
722
722
  const isAudioItem =
723
723
  entry?.content?.type?.includes?.("audio") ||
724
- entry?.type?.value === "audio";
724
+ entry?.type?.value?.includes?.("audio");
725
725
 
726
726
  const getStyle = (dimensions) => {
727
727
  const generalStyles = isAudioItem ? styles.audio : styles.video;
@@ -806,7 +806,6 @@ export default class VideoPlayer extends React.Component<
806
806
  nowPlayingEnabled,
807
807
  paused,
808
808
  seek,
809
- rate,
810
809
  textTrackId,
811
810
  liveSeekingEnabled,
812
811
  liveCatchUpEnabled,
@@ -817,7 +816,14 @@ export default class VideoPlayer extends React.Component<
817
816
  accessibilityProps: getAllAccessibilityProps(
818
817
  this.getPluginConfiguration()
819
818
  ),
820
- }; // rate temporary removed, because of bug with subtitles
819
+ };
820
+
821
+ if (!isAppleTV()) {
822
+ // TODO: Move to RN method and remove from props.
823
+ // Causes tvOS bug: native player passes rate on fast seek,
824
+ // RN returns it and it breaks playback.
825
+ nativeProps.rate = rate;
826
+ }
821
827
 
822
828
  if (
823
829
  this.isReactNativeMethodsSupported() &&