Bitmovin Player UI Framework

4.11.0 · active · verified Sun Apr 19

The `bitmovin-player-ui` package provides a flexible and modular UI framework designed to integrate with the Bitmovin Player API (specifically v8). It abstracts common player controls and displays into customizable components, allowing developers to easily adapt the player's appearance and functionality to specific application needs. Currently at version 4.11.0, the package demonstrates an active release cadence with frequent patch and minor updates focusing on fixes and feature additions, such as enhanced ad display logic and improved UI component exports. Key differentiators include its extensibility, native TypeScript support, and a design that encourages community contributions for further customization and feature development, moving beyond a rigid, predefined player interface.

Common errors

Warnings

Install

Imports

Quickstart

Initializes a Bitmovin Player (v8) with the default UI layout, attaching it to a specified HTML container element and loading a sample DASH stream.

import { Player } from 'bitmovin-player'; // Requires 'bitmovin-player' v8.x
import { UIFactory } from 'bitmovin-player-ui';
import 'bitmovin-player-ui/dist/css/bitmovinplayer-ui.css'; // Essential for styling

// 1. Get a reference to the container element where the player will be rendered
const playerContainer = document.getElementById('player-container');
if (!playerContainer) {
  console.error('Player container element not found! Make sure an element with id="player-container" exists in your HTML.');
  // In a real application, you might throw an error or handle this gracefully
} else {
  // 2. Initialize the Bitmovin Player with your license key
  const playerConfig = {
    key: process.env.BITMOVIN_PLAYER_KEY ?? 'YOUR_BITMOVIN_PLAYER_LICENSE_KEY_HERE', // Replace with your actual license key
    // Other player configurations can go here
  };
  const player = new Player(playerConfig);

  // 3. Initialize the UI factory and build the default UI for the player
  const uiFactory = new UIFactory();
  const uiManager = uiFactory.build(player, playerContainer);

  // 4. Load a video source
  player.load({
    dash: 'https://bitmovin-a.akamaihd.net/content/MIUI_Sample/MIUI_Sample.mpd',
    // Other source configurations
  }).then(() => {
    console.log('Bitmovin Player UI and source loaded successfully!');
    // player.play(); // Uncomment to auto-play after loading
  }).catch((error) => {
    console.error('Error loading player source:', error);
  });

  // For debugging or global access, expose player and uiManager
  (window as any).bitmovinPlayer = player;
  (window as any).bitmovinUIManager = uiManager;
}

view raw JSON →