How thewidlarzgroup/react-native-video works
Project type and purpose
• This is an open-source, cross-platform React Native module (“react-native-video”) that exposes a <Video> component.
• It provides a JavaScript/TypeScript interface (in src/), plus native implementations for Android (android/), iOS (ios/), Windows (windows/) and Web (src/Video.web.tsx).
• It also includes Expo plugins (src/expo-plugins/), documentation (docs/), example apps (examples/), build scripts (scripts/), and CI/CD definitions (.github/workflows/).
Main components
a. JavaScript/TypeScript layer
• src/index.ts and component files (Video.tsx, Video.web.tsx)
• Type definitions (src/types/) and native-specs (src/specs/)
• Expo plugin glue (src/expo-plugins/)
b. React Native Bridge
• Auto-generated/native-module registration that connects JS to platform code
• Spec contracts (NativeVideoManager, VideoNativeComponent)
c. Platform-specific native modules
• Android: Kotlin/Java code under android/src/main/java/... leveraging ExoPlayer, HLS, DASH, RTSP, caching, DRM, ads
• iOS: Swift/Obj-C code under ios/Video/ using AVPlayer, AVContentKeySession, IMA ads, PiP, caching
• Windows: C++/C# code under windows/ReactNativeVideoCPP*/ implementing React Package, View manager
d. External native SDKs & services
• ExoPlayer (Android), AVFoundation (iOS), Windows Media Foundation
• Google IMA SDK for ads
• DRM/license servers (via HTTP/URLSession)
e. Tooling & CI/CD
• Build/test pipelines in .github/workflows/ for Android, iOS, JS, docs
• Linting/format scripts (scripts/)
• Package publishing (package.json, react-native-video.podspec, release-it.json)
f. Documentation site
• Next.js project in docs/
• API reference, guides, asset pipeline, deployed via GitHub Actions
g. Example applications
• Bare React Native (examples/bare)
• Expo managed (examples/expo)
• Plugin sample (examples/react-native-video-plugin-sample)
Relationships & data-flow
• Examples import the published JS package and call the <Video> API (JS)
• Docs site reads TypeScript definitions / Markdown to generate API docs
• CI/CD pipelines run tests on each platform, build artifacts, and publish docs
Architectural patterns & design principles
• Bridge pattern: decoupling JS API from platform implementations
• Plugin architecture: Expo plugins augment native projects at build time
• Modular codegen: each platform’s code is isolated under its directory
• Single-repo monolith with multiple packages (code + docs + examples)
JS → Bridge → Native code → OS/SDK
CI/CD → Build → Publish → npm / CocoaPods / docs
• Protocols and technologies on connectors (e.g., HTTP, react-native bridge, Gradle, Xcode build)