Setting up Dependencies
Since Bitmovin's native Android SDK is distributed through a custom Maven repository, the installation cannot be managed by React Native's auto-linking and requires some extra steps. Please refer to the installation instructions for each platform below. For more information on integrating the native SDKs, you can refer to the Getting Started guides.
Adding the NPM package dependency
The library is available as an NPM package, and can be added as a dependency to your project using any node-based package manager, e.g.:
- npm:
npm install bitmovin-player-react-native --save
- yarn:
yarn add bitmovin-player-react-native
Setting up iOS dependencies
Run pod install
(try with --repo-update
in case of repository errors) in the ios
folder after installing the node package.
Make sure you're targeting a supported platform version. Here's an example ios/Podfile
:
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
source 'https://cdn.cocoapods.org'
# iOS version should be 14 or greater.
platform :ios, '14.0'
install! 'cocoapods', :deterministic_uuids => false
target 'MyApp' do
config = use_native_modules!
# Rest of Podfile...
Troubleshooting
In case of the following or similar error:
[!] Unable to find a specification for `GoogleAds-IMA-iOS-SDK (= 3.18.4)` depended upon by `RNBitmovinPlayer`
Please make sure you have set up the CocoaPods CDN source in your ios/Podfile
:
source 'https://cdn.cocoapods.org'
Now run pod install
again in the ios
folder - the error should now be resolved.
Setting up Android dependencies
The Android setup also needs an extra step in order to correctly resolve the Android Player SDK native dependency. Add Bitmovin's artifacts repository to the allprojects.repositories
section of your android/build.gradle
file:
allprojects {
repositories {
maven { url("$rootDir/../node_modules/react-native/android") }
maven { url("$rootDir/../node_modules/jsc-android/dist") }
mavenCentral {
content {
excludeGroup "com.facebook.react"
}
}
google()
maven { url 'https://www.jitpack.io' }
// Add Bitmovin's artifacts repository url
maven { url 'https://artifacts.bitmovin.com/artifactory/public-releases' }
}
}
Updated about 2 months ago