@pigeonmal/react-native-video 7.0.0-beta.2 β†’ 7.0.0-beta.3

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
@@ -1,163 +1,28 @@
1
- [![React Native Video Component](./docs/static/baners/rnv-banner.png)](https://thewidlarzgroup.com/?utm_source=rnv&utm_medium=readme&utm_id=banner)
1
+ Last commit sync : 1eb317a566a6d8ae9ee831a09dd931629e287ab5
2
+ Date: 18/12/2025
2
3
 
3
- The most battle-tested open-source video player component for React Native with support for DRM, offline playback, HLS/DASH streaming, and more.
4
-
5
- > [!IMPORTANT]
6
- > This is a new version (v7) of `react-native-video` that is currently in active development.
7
- > You can expect breaking changes and missing features.
8
- >
9
- > If you have any questions, please contact us at [hi@thewidlarzgroup.com](mailto:hi@thewidlarzgroup.com).
10
-
11
- ## πŸ” Features
12
-
13
- | Feature | Status |
14
- |---------|--------|
15
- | πŸ“± Plays all video formats natively supported by iOS/Android | βœ… Available & Production Ready by August |
16
- | ▢️ Local and remote playback | βœ… Available & Production Ready by August |
17
- | πŸ” Streaming: HLS β€’ DASH β€’ SmoothStreaming | βœ… Available & Production Ready by August |
18
- | 🧩 Expo plugin support | βœ… Available & Production Ready by August |
19
- | πŸ“΄ Offline playback, video download, support for side-tracks and side-captions (via [optional SDK](https://docs.thewidlarzgroup.com/offline-video-sdk?utm_source=rnv&utm_medium=readme&utm_id=features-text)) | βœ… Available & Production Ready by August |
20
- | πŸ“± Picture in Picture | βœ… Available & Production Ready by August |
21
- | 🎚️ Fine-grained control over tracks, buffering & events | πŸ—οΈ In Development |
22
- | 🧠 Advanced control over playback and buffering | πŸ“ [TODO](https://github.com/TheWidlarzGroup/react-native-video/issues/4604) |
23
- | πŸ” DRM: Widevine & FairPlay ([See free DRM stream example](https://www.thewidlarzgroup.com/services/free-drm-token-generator-for-video?utm_source=rnv&utm_medium=readme&utm_id=free-drm)) | πŸ“ [TODO](https://github.com/TheWidlarzGroup/react-native-video/issues/4606) |
24
- | 🌐 Basic Web Support | πŸ“ [TODO](https://github.com/TheWidlarzGroup/react-native-video/issues/4605) |
25
- | πŸ“Ί TV Support | πŸ“ [TODO](https://github.com/TheWidlarzGroup/react-native-video/issues/4607) |
26
- | πŸ₯½ VisionOS Support | πŸ“ [TODO](https://github.com/TheWidlarzGroup/react-native-video/issues/4608) |
27
-
28
-
29
-
30
- ## ✨ Project Status
31
-
32
- | Version | State | Architecture |
33
- |---------|-------|--------------|
34
- | **v5 and lower** | ❌ End-of-life [Commercial Support Available](https://www.thewidlarzgroup.com/blog/react-native-video-upgrade-challenges-custom-maintenance-support#how-we-can-help?utm_source=rnv&utm_medium=readme&utm_id=upgradev5) | Old Architecture |
35
- | **v6** | πŸ›  Maintained (community + TWG) | Old + New (Interop Layer) |
36
- | **v7** | πŸš€ Active Development | Old + New (Full Support) |
37
-
38
- `react-native-video` v7 introduces full support for the new React Native architecture, unlocking better performance, improved consistency, and modern native modules.
39
-
40
- ---
41
-
42
- ## πŸ“š Documentation & Examples
43
-
44
- - πŸ“– [Documentation](https://docs.thewidlarzgroup.com/react-native-video)
45
- - πŸ“¦ [Example: Basic Usage](https://github.com/TheWidlarzGroup/react-native-video/tree/v7/example)
46
- - πŸ“¦ [Example: Free DRM Stream](https://www.thewidlarzgroup.com/services/free-drm-token-generator-for-video?utm_source=rnv&utm_medium=readme&utm_id=free-drm)
47
- - πŸ“¦ Example: Offline SDK integration - In Progress πŸ—οΈ, will be available soon
48
-
49
- ## πŸš€ Quick Start
50
-
51
- ### Requirements
52
-
53
- - React Native 0.75 or higher
54
- - `react-native-nitro-modules` (>=0.27.2) - Please see [nitro requirements](https://nitro.margelo.com/docs/minimum-requirements)
55
-
56
- ### Install
57
-
58
- `react-native-video` requires `react-native-nitro-modules` (>=0.27.2) in your project.
59
- ```bash
60
- npm install react-native-nitro-modules
4
+ (Only android)
5
+ Install :
6
+ 1) npm install @pigeonmal/react-native-video@beta react-native-nitro-fetch
7
+ 2) Add this to android/app/settings.gradle
61
8
  ```
9
+ include ':media3-ffmpeg-decoder'
62
10
 
63
- Then install `react-native-video`
64
-
65
- ```bash
66
- # Install the beta version of react-native-video v7
67
- npm install react-native-video@beta
68
-
69
- # Install pods
70
- cd ios && pod install
71
- ```
72
-
73
- <details>
74
- <summary>For react-native < 0.80</summary>
75
- `react-native` < 0.80 have bug that prevents to properly handle errors by nitro modules on Android.
76
- We highly recommend to apply bellow patch for `react-native-nitro-modules` to fix this issue.
77
- You can apply it using `patch-package`.
78
-
79
- Without this patch you won't be able "recognize" errors, all will be thrown as unknown errors.
80
-
81
- see [installation guide](https://docs.thewidlarzgroup.com/react-native-video/docs/v7/installation#patch-for-react-native--080)
82
- </details>
83
-
84
- ### Usage
85
- ```tsx
86
- import { useVideoPlayer, VideoView } from 'react-native-video';
87
-
88
- export default () => (
89
- const player = useVideoPlayer(
90
- 'https://www.w3schools.com/html/mov_bbb.mp4',
91
- (_player) => {
92
- _player.play();
93
- }
94
- );
95
-
96
- <VideoView
97
- player={player}
98
- style={{ width: '100%', aspectRatio: 16 / 9 }}
99
- controls
100
- />
101
- );
11
+ project(':media3-ffmpeg-decoder').projectDir = file('../../node_modules/react-native-video/android/media3-ffmpeg-decoder')
102
12
  ```
13
+ 3) create a patch for react-native-nitro-fetch like in the patches/react-native-nitro-fetch@x.patch
103
14
 
104
15
  ---
105
-
106
- ## 🧩 Plugins
107
-
108
- <a href="https://www.thewidlarzgroup.com/offline-video-sdk?utm_source=rnv&utm_medium=readme&utm_id=banner">
109
- <img src="./docs/static/baners/sdk-banner.png" alt="Offline SDK Preview" width="40%" align="right" />
110
- </a>
111
-
112
- ### 1 Β· πŸ“₯ Offline SDK
113
-
114
- Enable offline streaming with full control over downloads, license lifecycle, secure storage, and media access.
115
-
116
- - Track selection (bitrate, audio, subtitles)
117
- - Pause / resume & background queueing
118
- - Expiration & auto-cleanup
119
- - Built for Android & iOS
120
- - β†’ [Read the SDK Docs](https://docs.thewidlarzgroup.com/offline-video-sdk?utm_source=rnv&utm_medium=readme&utm_id=modules-sdk-text)
121
-
122
- ### 2 Β· πŸ§ͺ Architecture
123
-
124
- Write your own plugins to extend library logic, attach analytics or add custom workflows - **without forking** the core SDK.
125
- β†’ [Plugin documentation](https://docs.thewidlarzgroup.com/react-native-video/other/plugin)
126
-
127
- ---
128
-
129
- ## πŸ’Ό TWG Services & Products
130
-
131
- | Offering | Description |
132
- |----------|-------------|
133
- | [**Professional Support Packages**](https://www.thewidlarzgroup.com/issue-boost?utm_source=rnv&utm_medium=readme&utm_campaign=professional-support-packages#Contact) | Priority bug-fixes, guaranteed SLAs, [roadmap influence](https://github.com/orgs/TheWidlarzGroup/projects/6) |
134
- | [**Issue Booster**](https://www.thewidlarzgroup.com/issue-boost?utm_source=rnv&utm_medium=readme) | Fast-track urgent fixes with a pay‑per‑issue model |
135
- | [**Offline Video SDK**](https://www.thewidlarzgroup.com/offline-video-sdk/?utm_source=rnv&utm_medium=readme&utm_campaign=downloading&utm_id=offline-video-sdk-link) | Plug‑and‑play secure download solution for iOS & Android |
136
- | [**Integration Support**](https://www.thewidlarzgroup.com/?utm_source=rnv&utm_medium=readme&utm_campaign=integration-support#Contact) | Hands‑on help integrating video, DRM & offline into your app |
137
- | [**Free DRM Token Generator**](https://www.thewidlarzgroup.com/services/free-drm-token-generator-for-video?utm_source=rnv&utm_medium=readme&utm_id=free-drm) | Generate Widevine / FairPlay tokens for testing |
138
- | [**Ready Boilerplates**](https://www.thewidlarzgroup.com/showcases?utm_source=rnv&utm_medium=readme) | Ready-to-use apps with offline HLS/DASH DRM, video frame scrubbing, TikTok-style video feed, background uploads, Skia-based frame processor (R&D phase), and more |
139
- | [**React Native Video Upgrade Guide**](https://www.thewidlarzgroup.com/blog/react-native-video-upgrade-challenges-custom-maintenance-support?utm_source=rnv&utm_medium=readme&utm_id=upgrade-blog&utm_campaign=v7) | Common upgrade pitfalls & how to solve them |
140
-
141
- *See how [TWG](https://www.thewidlarzgroup.com/?utm_source=rnv&utm_medium=readme&utm_id=services-text) helped **Learnn** ship a world‑class player in record time - [case study](https://gitnation.com/contents/a-4-year-retrospective-lessons-learned-from-building-a-video-player-from-scratch-with-react-native).*
142
-
143
- Contact us at [hi@thewidlarzgroup.com](mailto:hi@thewidlarzgroup.com)
144
-
145
- ## 🌍 Social
146
-
147
- - 🐦 **X / Twitter** - [follow product & release updates](https://x.com/TheWidlarzGroup)
148
- - πŸ’¬ **Discord** - [talk to the community and us](https://discord.gg/9WPq6Yx)
149
- - πŸ’Ό **LinkedIn** - [see TWG flexing](https://linkedin.com/company/the-widlarz-group)
150
-
151
- ## πŸ“° Community & Media
152
-
153
- - πŸ—½ **React Summit US** – How TWG helped Learnn boost video performance on React Native.
154
- [Watch the talk Β»](https://gitnation.com/contents/a-4-year-retrospective-lessons-learned-from-building-a-video-player-from-scratch-with-react-native)
155
-
156
- - 🧨 **v7 deep dive** – Why we’re building v7 with Nitro Modules
157
- [Watch on X Β»](https://x.com/krzysztof_moch/status/1854162551946478051)
158
-
159
- - πŸ› οΈ **Well-maintained open-source library** - What does it truly mean? - Bart's talk for React Native Warsaw
160
- [Watch here Β»](https://www.youtube.com/watch?v=RAQQwGCQNqY)
161
-
162
- - πŸ“Ί **β€œOver the Top” Panel** - Building Streaming Apps for Mobile, Web, and Smart TVs - Bart giving his insights on the industry
163
- [Watch here Β»](https://youtu.be/j2b_bG-32JI)
16
+ Features:
17
+ - ffmpeg fallback
18
+ - videoconfig: externalAudios (array of AudioTrack)
19
+ - videoconfig: forceType 'm3u8' or 'mpd' if url not have explicit extension
20
+ - videoconfig: forceOkhttp cronet by default but still okhttp work
21
+ - videoconfig: initialSubtitleDelay (ms positive or negative)
22
+ - player.subtitleDelay for subtitle delay adjust (ms positive or negative)
23
+ - player.getAllPlayerTracks() for get all current tracks (audios, videos, texts)
24
+ - player.selectTrackById and selectTrackByIndex for select video or audio or text
25
+ - player.selectTextTrack removed use selectTrackById(TrackType.TEXT, trackId)
26
+ - TextTrack type replaced to PlayerTrack
27
+ - removed onTrackChange event
28
+ - allPlayerTracks in onLoadData event directly
@@ -1,12 +1,42 @@
1
1
  package com.margelo.nitro.video
2
2
 
3
+ import android.content.Context
4
+ import android.net.Uri
5
+ import androidx.media3.common.MediaItem
6
+ import androidx.media3.datasource.RawResourceDataSource
7
+ import com.facebook.react.bridge.ReactApplicationContext
3
8
  import com.facebook.proguard.annotations.DoNotStrip
9
+ import com.margelo.nitro.NitroModules
4
10
 
5
11
  @DoNotStrip
6
12
  class HybridVideoPlayerSourceFactory: HybridVideoPlayerSourceFactorySpec() {
13
+ private val applicationContext: Context
14
+ get() = NitroModules.applicationContext
15
+ ?: throw IllegalStateException(
16
+ "NitroModules.applicationContext has not been initialized."
17
+ )
18
+
19
+ private fun normalizeUri(input: String): String {
20
+ val parsedUri = Uri.parse(input)
21
+
22
+ if (parsedUri.scheme != null) {
23
+ return parsedUri.toString()
24
+ }
25
+
26
+ val resId = applicationContext.resources
27
+ .getIdentifier(input, "raw", applicationContext.packageName)
28
+
29
+ if (resId == 0) {
30
+ throw IllegalArgumentException("The video resource '$input' could not be found in res/raw")
31
+ }
32
+
33
+ val mediaUri = RawResourceDataSource.buildRawResourceUri(resId)
34
+
35
+ return mediaUri.toString()
36
+ }
7
37
  override fun fromUri(uri: String): HybridVideoPlayerSourceSpec {
8
38
  val config = NativeVideoConfig(
9
- uri = uri,
39
+ uri = normalizeUri(uri),
10
40
  externalSubtitles = null,
11
41
  drm = null,
12
42
  headers = null,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pigeonmal/react-native-video",
3
- "version": "7.0.0-beta.2",
3
+ "version": "7.0.0-beta.3",
4
4
  "description": "<Video /> Component for React Native",
5
5
  "source": "./src/index.tsx",
6
6
  "main": "./lib/commonjs/index.js",