Attention! This plugin is not official, the code is not provided or maintained by Bitmovin!
- Disable auto link, create
react-native.config.js
archive in root folder.
module.exports = {
dependencies: {
'react-native-bitmovin-player': {
platforms: {
android: null,
ios: null,
},
},
},
};
- Install react-native-bitmovin-player fork.
$ yarn add https://github.com/fhugoduarte/react-native-bitmovin-player.git
- In XCode, in the project navigator, right click
Libraries
➜Add Files to [your project's name]
- Go to
node_modules
➜react-native-bitmovin-player
and addRNBitmovinPlayer.xcodeproj
- In XCode, in the project navigator, select your project. Add
libRNBitmovinPlayer.a
to your project'sBuild Phases
➜Link Binary With Libraries
- Run your project (
Cmd+R
)
- Open up
android/app/src/main/java/[...]/MainApplication.java
- Add
import com.xxsnakerxx.RNBitmovinPlayer.RNBitmovinPlayerPackage;
to the imports at the top of the file - Add
new RNBitmovinPlayerPackage()
to the list returned by thegetPackages()
method
- Append the following lines to
android/settings.gradle
:include ':react-native-bitmovin-player' project(':react-native-bitmovin-player').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-bitmovin-player/android')
- Insert the following lines inside the dependencies block in
android/app/build.gradle
:implementation project(':react-native-bitmovin-player')
Add line to your Podfile
pod 'BitmovinPlayer', git: 'https://github.com/bitmovin/bitmovin-player-ios-sdk-cocoapod.git', tag: '2.36.0'
.
After that, install the pod using pod install
.
Add a link to our release repository to your application's build.gradle
file. In addition to that, the google maven repository must be added.
allprojects {
repositories {
...
google()
maven {
url 'http://bitmovin.bintray.com/maven'
}
}
}
Add the Bundle identifier of the iOS application which is using the SDK as an allowed domain to the Bitmovin licensing backend. This can also be done under Player -> Licenses
when logging in into https://dashboard.bitmovin.com with your account.
When you do not do this, you'll get a license error when starting the application which contains the player.
Add your Bitmovin player license key to the Info.plist
file as BitmovinPlayerLicenseKey.
Add your Bitmovin player license key to the AndroidManifest.xml
.
<meta-data android:name="BITMOVIN_PLAYER_LICENSE_KEY" android:value="YOUR_KEY_HERE" />
Your player license key can be found when logging in into https://dashboard.bitmovin.com and navigating to Player -> Licenses
.
Add permissions to the AndroidManifest.xml
.
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.DOWNLOAD_WITHOUT_NOTIFICATION" />
Enable allowBackup to the AndroidManifest.xml
.
<application
...
android:allowBackup="true">
import BitmovinPlayer from 'react-native-bitmovin-player';
// please follow to index.js for available props
<BitmovinPlayer
configuration={{
source: {
title: 'It works',
url: 'https://bitdash-a.akamaihd.net/content/sintel/hls/playlist.m3u8',
},
}}
/>