This sample shows how to integrate React Native with the Brightcove Player SDKs for iOS. The reader is expected to be familiar with both React Native and the Brightcove SDK; this is not a React Native tutorial and Brightcove cannot provide support for React Native. The React Native development environment must be set up first.
This sample uses CocoaPods (see the CocoaPods note in the root README).
- Platform: iOS.
- Minimum OS: iOS 14.0.
- Toolchain: Node.js, yarn, CocoaPods 1.11+, Xcode 15.0+.
- Extra SDKs: the Brightcove SDK via CocoaPods (the
Brightcove-Player-IMApod, which pulls inBrightcove-Player-Core).
- Install the JS dependencies with
yarn install. - In
ios, runpod install. - Start the Metro server with
yarn start. - Open
ReactNativePlayer.xcworkspaceand run on a simulator or device.
The native Brightcove player is exposed to React Native as a native view component. On the native side (ios/ReactNativePlayer/), a view manager registers a BCOVVideoPlayer component and exports its events and methods; on the JS side (src/), requireNativeComponent('BCOVVideoPlayer') renders it with a JS controls overlay.
The project is configured to support the IMA plugin. The IMA-related code is commented out by default so the project builds without exercising the IMA dependency; uncomment it to enable IMA ads.