One video player API across Android, iOS, web — and React Native.
ogplayer-react-native is a thin Fabric (New Architecture) wrapper over the
published OGPlayer native SDKs: the same Maven Central AAR and the same
XCFrameworks that native apps use. Rendering, playback, DRM, ads and the
player chrome are 100% native; this package adds a typed TypeScript API and
a <OGPlayerView> component.
import { OGPlayerView } from 'ogplayer-react-native';
<OGPlayerView
style={{ width: '100%', aspectRatio: 16 / 9 }}
source={{ url: 'https://cdn.example.com/master.m3u8', title: 'My stream' }}
autoplay
onStateChanged={(s) => console.log(s)}
/>
VOD, live and live-DVR · multi-DRM (Widevine / FairPlay) with a JS
tokenProvider called on every license request · Google IMA ads ·
playlists with a themeable "Up next" card · a swipeable vertical video
feed (<OGVerticalFeedView>) · embedded + sideloaded subtitles,
multi-audio, quality selection · full native player chrome (configurable
down to headless, with your own action icons by name) · watermark
overlays in nine anchored slots · posters, content ratings, custom error
copy and styling · one event stream mirroring the native listeners.
Not yet available in React Native: FreeWheel ads (use the native Android/iOS SDKs if you need FreeWheel today).
npm install ogplayer-react-native
cd ios && pod install # fetches the OGPlayer XCFrameworks automatically
The Android SDK resolves from Maven Central; the iOS frameworks download from the official release at pod-install time. This package wraps OGPlayer Android 1.0.3 and OGPlayer iOS 1.0.4.
castEnabled: declare the Cast options provider in your app
manifest — <meta-data android:name="com.google.android.gms.cast.framework.OPTIONS_PROVIDER_CLASS_NAME" android:value="com.ogplayer.cast.OGCastOptionsProvider"/>Info.plist and forward supportedInterfaceOrientationsFor to
OGRNPlayerHost.interfaceOrientationMask in your AppDelegate (two
lines — see the demos app). Without it the player stays embedded.Set castEnabled on <OGPlayerView> and declare the options provider in
your Android manifest (see Requirements). The SDK's cast button then appears
in the player controls whenever a receiver is reachable; tapping it opens
the device picker and hands playback off to the TV.
Bringing your own cast UI. Google Cast sessions are app-global, not
button-scoped: OGPlayer's connector listens to the app's shared
CastContext and engages when any cast session starts — regardless of
which button started it. That means you can hide the SDK's button
(uiConfig: { showCastButton: false }) and present your own cast entry
point, e.g. the CastButton from
react-native-google-cast;
the session it starts triggers the same handoff.
Two integration notes when combining libraries:
com.ogplayer.cast.OGCastOptionsProvider) — other
libraries' cast buttons ride on whatever provider the app declares.On iOS the equivalent is AirPlay: the SDK's button opens the system route
picker, and hiding it leaves AirPlay available via Control Center or your
own AVRoutePickerView.
Free to evaluate with the OGPlayer watermark; production use requires a commercial license key — https://ogplayer.tv/docs/getting-started/licensing/