Setting up Dependencies

For v1.0.0 and Newer

Starting with v1.0.0, the Bitmovin Player React Native SDK has been fully migrated to use Expo Modules API, providing automatic native configuration through Expo's config plugin system.

Installation

Install the package using your preferred package manager:

  • npm: npm install bitmovin-player-react-native
  • yarn: yarn add bitmovin-player-react-native
  • Expo CLI: npx expo install bitmovin-player-react-native

Configuration

Add the Expo config plugin to your app.config.ts (or app.json for JSON configuration):

import { ExpoConfig } from 'expo/config';

const config: ExpoConfig = {
  // ... your existing config
  plugins: [
    [
      'bitmovin-player-react-native',
      {
        playerLicenseKey: 'YOUR_PLAYER_LICENSE_KEY',
        features: {
          airPlay: true,
          backgroundPlayback: true,
          googleCastSDK: {
            android: '21.3.0',
            ios: '4.8.1.2'
          }
          offline: true,
          pictureInPicture: true,
        }
      }
    ]
  ]
}

Generate Native Projects

Run the prebuild command to generate the native iOS and Android projects with automatic configuration:

npx expo prebuild

This automatically:

  • Configures iOS dependencies and CocoaPods
  • Sets up Android Maven repositories
  • Applies your license key to native configurations
  • Enables requested features

Platform Requirements

  • iOS/tvOS: 15.1+
  • Android: API 24+ (Android 7.0+)
  • React Native: 0.79.5+
  • Expo SDK: 53.0+

Migration from Earlier Versions

If you're upgrading from a version prior to v1.0.0, see our Migration Guide for step-by-step instructions.


For Versions Prior to v1.0.0

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' }
    }
}