@pigeonmal/react-native-video 7.0.0-beta.13 → 7.0.0-beta.15

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/README.md CHANGED
@@ -4,7 +4,7 @@ Date: 19/12/2025
4
4
  (Only android)
5
5
  Install :
6
6
 
7
- 1. npm install @pigeonmal/react-native-video@beta react-native-nitro-fetch
7
+ 1. npm install @pigeonmal/react-native-video@beta @pigeonmal/react-native-nitro-fetch
8
8
  2. Add this to android/app/settings.gradle
9
9
 
10
10
  ```
@@ -12,8 +12,6 @@ include ':media3-ffmpeg-decoder'
12
12
  project(':media3-ffmpeg-decoder').projectDir = file('../node_modules/@pigeonmal/react-native-video/android/media3-ffmpeg-decoder')
13
13
  ```
14
14
 
15
- 3. create a patch for react-native-nitro-fetch like in the patches/react-native-nitro-fetch@x.patch
16
-
17
15
  ---
18
16
 
19
17
  Features:
@@ -234,7 +234,7 @@ dependencies {
234
234
  implementation "androidx.media3:media3-session:$media3_version"
235
235
 
236
236
  api project(':media3-ffmpeg-decoder')
237
- implementation project(':react-native-nitro-fetch')
237
+ implementation project(':pigeonmal_react-native-nitro-fetch')
238
238
 
239
239
  if (ExoplayerDependencies.useExoplayerDash) {
240
240
  implementation "androidx.media3:media3-exoplayer-dash:$media3_version"
@@ -60,7 +60,7 @@ fun buildHttpDataSourceFactory(context: Context, source: HybridVideoPlayerSource
60
60
  fun buildCronetHttpDataSourceFactory(source: HybridVideoPlayerSourceSpec): CronetDataSource.Factory {
61
61
  // Get Cronet engine and executor from NitroFetch
62
62
  // used before NitroFetch.ioExecutor , but cause blocking thread
63
- val factory = CronetDataSource.Factory(NitroFetch.getEngine(), Executors.newSingleThreadExecutor())
63
+ val factory = CronetDataSource.Factory(NitroFetch.getEngine(), NitroFetch.ioExecutor)
64
64
  .setConnectionTimeoutMs(10_000)
65
65
  .setReadTimeoutMs(10_000)
66
66
  .setResetTimeoutOnRedirects(true)
@@ -499,19 +499,12 @@ class HybridVideoPlayer() : HybridVideoPlayerSpec(), AutoCloseable {
499
499
  eventEmitter.onBuffer(false)
500
500
 
501
501
  val allTracks = TrackUtils.getAllPlayerTracksInternal(player)
502
- val selectedVideo: VideoPlayerTrack? = player.videoFormat?.let { format ->
503
- VideoPlayerTrack(
504
- width = format.width.toDouble(),
505
- height = format.height.toDouble(),
506
- // We don't care for the true information, we use only width and height
507
- id = "general",
508
- label = "General",
509
- selected = true,
510
- language = null
511
- )
512
- } ?: allTracks.videos.firstOrNull { it.selected }
513
- val width = selectedVideo?.width ?: 0.0
514
- val height = selectedVideo?.height ?: 0.0
502
+ val (width, height) = player.videoFormat?.let { format ->
503
+ format.width.toDouble() to format.height.toDouble()
504
+ } ?: allTracks.videos.firstOrNull { it.selected }?.let {
505
+ it.width to it.height
506
+ } ?: (0.0 to 0.0)
507
+
515
508
  // val rotationDegrees = selectedVideoTrackFormat?.rotationDegrees ?: generalVideoFormat?.rotationDegrees
516
509
 
517
510
  eventEmitter.onLoad(
@@ -658,12 +651,14 @@ class HybridVideoPlayer() : HybridVideoPlayerSpec(), AutoCloseable {
658
651
 
659
652
  override fun resetForReuse() {
660
653
  runOnMainThread {
661
- stopProgressUpdates()
662
- this.source = null
663
- if (player.playbackState != Player.STATE_IDLE) {
664
- player.stop()
654
+ if (this.source != null) {
655
+ stopProgressUpdates()
656
+ this.source = null
657
+ if (player.playbackState != Player.STATE_IDLE) {
658
+ player.stop()
659
+ }
660
+ player.clearMediaItems()
665
661
  }
666
- player.clearMediaItems()
667
662
  }
668
663
  }
669
664
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pigeonmal/react-native-video",
3
- "version": "7.0.0-beta.13",
3
+ "version": "7.0.0-beta.15",
4
4
  "description": "<Video /> Component for React Native",
5
5
  "source": "./src/index.tsx",
6
6
  "main": "./lib/commonjs/index.js",
@@ -94,7 +94,7 @@
94
94
  "react": "*",
95
95
  "react-native": "*",
96
96
  "react-native-nitro-modules": ">=0.27.2",
97
- "react-native-nitro-fetch": ">=0.1.6"
97
+ "@pigeonmal/react-native-nitro-fetch": ">=0.1.7"
98
98
  },
99
99
  "release-it": {
100
100
  "npm": {