npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@bitmovin/player-react-native-google-dai

v0.4.0

Published

Optional Google IMA DAI companion package for Bitmovin Player React Native.

Readme

Bitmovin Player React Native Google DAI

Optional companion package for Google IMA Dynamic Ad Insertion (DAI/SSAI) support in bitmovin-player-react-native.

Installation

yarn add bitmovin-player-react-native @bitmovin/player-react-native-google-dai

The package is an Expo module; Expo autolinking handles native installation.

Add the bitmovin-player-react-native config plugin to your app configuration, or merge these options into its existing entry:

Player React Native 1.30.0 and newer: Set features.googleIMA: true. Google DAI requires IMA, which is disabled by default in these versions. Earlier core versions include IMA by default.

const config = {
  // ...
  plugins: [
    [
      'bitmovin-player-react-native',
      {
        playerLicenseKey: 'YOUR_BITMOVIN_PLAYER_LICENSE_KEY',
        features: {
          googleIMA: true,
        },
      },
    ],
  ],
};

iOS native dependency

Native Google DAI is installed through Swift Package Manager (SPM), sharing the Player and IMA dependencies with the core React Native wrapper. CocoaPods still installs the React Native bridges and Expo modules.

The core config plugin links the Player and IMA frameworks to the app target. For apps maintained without Expo prebuild, follow the core wrapper's iOS dependency guide to configure these dependencies.

Compatibility

| Component | Requirement | | ---------------------------- | ----------- | | Bitmovin Player React Native | >=1.27.1 | | Expo | >=54.0.0 | | React Native | >=0.75.0 |

Android consumers must include the Bitmovin public releases repository:

repositories {
    maven {
        url = uri("https://artifacts.bitmovin.com/artifactory/public-releases")
    }
}

Android release builds require core library desugaring for the Google IMA dependency. Expo apps using the bitmovin-player-react-native config plugin get this automatically; manual/native setups or Kotlin DSL Gradle files must configure it in the app module (android/app/build.gradle(.kts)):

android {
    compileOptions {
        isCoreLibraryDesugaringEnabled = true
    }
}

dependencies {
    coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.5")
}

Compatible native Google DAI integrations and Android Player SDK versions are pinned by each package release and should not be overridden.

Usage

import { useCallback, useEffect, useMemo } from 'react';
import { Player, PlayerView } from 'bitmovin-player-react-native';
import {
  GoogleDaiSourceType,
  withGoogleDai,
} from '@bitmovin/player-react-native-google-dai';

export function GoogleDaiPlayer() {
  const player = useMemo(
    () =>
      withGoogleDai(
        new Player({
          playbackConfig: {
            isAutoplayEnabled: true,
          },
        })
      ),
    []
  );

  useEffect(() => {
    return () => player.destroy();
  }, [player]);

  const loadGoogleDai = useCallback(() => {
    void player.googleDai
      .load({
        kind: 'live',
        assetKey: '...',
        type: GoogleDaiSourceType.HLS,
        apiKey: '...',
        networkCode: '...',
      })
      .then(() => player.play())
      .catch((error) => console.warn('Google DAI load failed', error));
  }, [player]);

  return (
    <PlayerView
      player={player}
      onPlayerViewReady={loadGoogleDai}
      onPlayerError={(event) => console.warn(event)}
      onAdStarted={(event) => console.warn('ad started', event)}
    />
  );
}

withGoogleDai(player) preserves the player identity and returns Player & GoogleDaiCapability. The native DAI adapter is initialized lazily by player.googleDai.load(). Call load() after PlayerView.onPlayerViewReady; it does not initialize the core player.

Source config

export enum GoogleDaiSourceType {
  /**
   * @platform Android
   */
  DASH = 'dash',
  HLS = 'hls',
}

export interface GoogleDaiLiveSourceConfig {
  kind: 'live';
  assetKey: string;
  type: GoogleDaiSourceType;
  apiKey?: string;
  networkCode?: string;
  adTagParameters?: Record<string, string>;
}

Only live DAI streams are supported; VOD configurations are rejected. iOS supports HLS only; DASH is Android-only.

Note: Seeking or time-shifting back into an already-played Google DAI ad segment does not replay IMA ad lifecycle events. The media may play again, but ad events are emitted only according to Google IMA DAI tracking state.

Example app

This repository includes a minimal Expo dev-client sample under example/ that installs this package via file:.., configures the core bitmovin-player-react-native plugin with BITMOVIN_PLAYER_LICENSE_KEY, and loads Google's public live DAI HLS test stream.

cd example
yarn install
cp .env.example .env
# edit .env and set BITMOVIN_PLAYER_LICENSE_KEY
yarn prebuild
yarn android
# or
yarn ios

Migrating to 0.4.0 - iOS only

Version 0.4.0 of this integration moves native Google DAI to Swift Package Manager (SPM) to share Player and IMA dependencies with the core React Native wrapper. It requires Player React Native 1.27.1 or newer, which includes the archive signature fix.

To migrate an existing CocoaPods-based DAI integration:

  1. Update this integration to 0.4.0 and ensure Player React Native is 1.27.1 or newer.
  2. Remove BitmovinGoogleDAIPlayer from ios.extraPods in expo-build-properties, or from your Podfile if it was declared there directly.
  3. Configure the core plugin as shown under Installation. With Player React Native 1.30.0 or newer, enable features.googleIMA.
  4. Regenerate the native iOS project and install pods:
yarn expo prebuild --platform ios --no-install
(cd ios && pod install)

Then rebuild the app using your usual Expo or React Native workflow.

Contributing and license

Contributions are welcome; see CONTRIBUTING.md. This project is available under the MIT License.