@applicaster/quick-brick-player 13.0.0-rc.127 → 13.0.0-rc.128

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-rc.127",
3
+ "version": "13.0.0-rc.128",
4
4
  "description": "Quick Brick Player",
5
5
  "main": "./src/index.ts",
6
6
  "types": "index.d.ts",
@@ -37,9 +37,9 @@
37
37
  "dependencies": {
38
38
  "@applicaster/quick-brick-mobile-transport-controls": "13.0.0-rc.124",
39
39
  "@applicaster/quick-brick-tv-transport-controls": "13.0.0-rc.56",
40
- "@applicaster/zapp-react-native-tvos-app": "13.0.0-rc.127",
41
- "@applicaster/zapp-react-native-ui-components": "13.0.0-rc.127",
42
- "@applicaster/zapp-react-native-utils": "13.0.0-rc.127",
40
+ "@applicaster/zapp-react-native-tvos-app": "13.0.0-rc.128",
41
+ "@applicaster/zapp-react-native-ui-components": "13.0.0-rc.128",
42
+ "@applicaster/zapp-react-native-utils": "13.0.0-rc.128",
43
43
  "query-string": "7.1.3",
44
44
  "react-native-web-linear-gradient": "1.1.2",
45
45
  "shaka-player": "4.3.5",
@@ -50,6 +50,7 @@ const styles = StyleSheet.create({
50
50
  position: "absolute",
51
51
  zIndex: 1,
52
52
  },
53
+ audioPlayerSize: { width: "100%", height: "100%" },
53
54
  playerSize: { width: "100%", height: "100%" },
54
55
  });
55
56
 
@@ -58,6 +59,10 @@ const logger = createLogger({
58
59
  subsystem: Subsystem,
59
60
  });
60
61
 
62
+ const isTvOS = isTvOSPlatform();
63
+
64
+ const AUDIO_PLAYER_NATIVE_ID = "audio-player-view";
65
+
61
66
  export default class VideoPlayer extends React.Component<
62
67
  QuickBrickPlayer.PlayerProps,
63
68
  QuickBrickPlayer.NativePlayerState
@@ -93,6 +98,8 @@ export default class VideoPlayer extends React.Component<
93
98
  // Player state
94
99
  currentTime: 0,
95
100
  duration: 0,
101
+
102
+ nativePlayerIsReady: false,
96
103
  };
97
104
 
98
105
  private _tracker: PlayerAnalyticsTrackerI;
@@ -488,6 +495,9 @@ export default class VideoPlayer extends React.Component<
488
495
 
489
496
  onVideoFullscreenPlayerDidPresent = () => {
490
497
  this.props.listener?.onVideoFullscreenPlayerDidPresent?.();
498
+
499
+ // we have to have a signal that player is ready, in order to show audio_player(for example)
500
+ this.setState({ nativePlayerIsReady: true });
491
501
  };
492
502
 
493
503
  onVideoFullscreenPlayerWillDismiss = () => {
@@ -674,7 +684,7 @@ export default class VideoPlayer extends React.Component<
674
684
  };
675
685
 
676
686
  childrenWithPlayNext = () => {
677
- if (!isTvOSPlatform() || !this.getPlayNextData()) {
687
+ if (!isTvOS || !this.getPlayNextData()) {
678
688
  return this.props.children;
679
689
  }
680
690
 
@@ -699,6 +709,32 @@ export default class VideoPlayer extends React.Component<
699
709
  ];
700
710
  };
701
711
 
712
+ childrenWithAudioPlayer = () => {
713
+ if (!isTvOS) {
714
+ return this.props.children;
715
+ }
716
+
717
+ const { nativePlayerIsReady } = this.state;
718
+
719
+ // we have to wait ready status of native player view, before showing audio_player
720
+ if (!nativePlayerIsReady) {
721
+ return this.props.children;
722
+ }
723
+
724
+ const { entry, children = [] } = this.props;
725
+
726
+ return [
727
+ ...children,
728
+ <View nativeID={AUDIO_PLAYER_NATIVE_ID} key={AUDIO_PLAYER_NATIVE_ID}>
729
+ <AudioPlayer
730
+ style={styles.audioPlayerSize}
731
+ audio_item={entry}
732
+ plugin_configuration={this.getPluginConfiguration()}
733
+ />
734
+ </View>,
735
+ ];
736
+ };
737
+
702
738
  get supportNativeCast() {
703
739
  return this.props.controller.supportNativeCast();
704
740
  }
@@ -723,7 +759,8 @@ export default class VideoPlayer extends React.Component<
723
759
 
724
760
  const isAudioItem =
725
761
  entry?.content?.type?.includes?.("audio") ||
726
- entry?.type?.value?.includes?.("audio");
762
+ entry?.type?.value?.includes?.("audio") ||
763
+ entry?.content?.src?.includes?.("type=audio");
727
764
 
728
765
  const getStyle = (dimensions) => {
729
766
  const generalStyles = isAudioItem ? styles.audio : styles.video;
@@ -1107,6 +1144,14 @@ export default class VideoPlayer extends React.Component<
1107
1144
  const renderTVPlayer = () => {
1108
1145
  return (
1109
1146
  <View style={this.takeParentStyle} testID={"player-view"}>
1147
+ {!isTvOS && isAudioItem ? (
1148
+ <AudioPlayer
1149
+ style={getStyle(styles.audioPlayerSize)}
1150
+ audio_item={entry}
1151
+ plugin_configuration={this.getPluginConfiguration()}
1152
+ />
1153
+ ) : null}
1154
+
1110
1155
  <this.props.PlayerComponent
1111
1156
  ref={this._assignRoot}
1112
1157
  {...nativeEvents}
@@ -1116,11 +1161,12 @@ export default class VideoPlayer extends React.Component<
1116
1161
  pluginConfiguration={this.getPluginConfiguration()}
1117
1162
  controller={this.props.controller}
1118
1163
  >
1164
+ {this.childrenWithAudioPlayer()}
1119
1165
  {this.childrenWithPlayNext()}
1120
1166
  </this.props.PlayerComponent>
1121
1167
 
1122
1168
  {renderTransportControls(this.takeParentStyle)}
1123
- {!isTvOSPlatform() && (
1169
+ {!isTvOS && (
1124
1170
  <PlayNextOverlay
1125
1171
  item={entry}
1126
1172
  playerIsDocked={docked}