Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslnode 18–226 runs
build_error
glibcnode 18–226 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
UIFactory
✓ import { UIFactory } from 'bitmovin-player-ui';
✗ const UIFactory = require('bitmovin-player-ui').UIFactory;
The primary class for creating and managing player UI instances. Ensure your build system supports ES Modules.
PlayerUI
✓ import { PlayerUI } from 'bitmovin-player-ui';
Represents a single UI instance attached to a player. Typically created via `UIFactory.build()`.
UIConfig
✓ import type { UIConfig } from 'bitmovin-player-ui';
✗ import { UIConfig } from 'bitmovin-player-ui';
Type definition for configuring the UI. Use `import type` for interfaces to ensure it's removed during compilation.
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;
}
Errors
Common errors & fixes
TypeError: UIFactory is not a constructor
Attempting to instantiate `UIFactory` in a CommonJS environment without proper transpilation or using incorrect `require()` syntax.
fixEnsure you are using ES module imports (`import { UIFactory } from 'bitmovin-player-ui';`) and your project is configured for ESM. If strictly in CommonJS, you may need a bundler like Webpack or Rollup to correctly handle ESM imports, or ensure your `tsconfig.json`'s `module` option is set appropriately for your target. Player container element not found! Make sure an element with id="player-container" exists in your HTML.
The HTML element specified as the target container for the player UI (e.g., `document.getElementById('player-container')`) does not exist or has an incorrect ID in the DOM when the JavaScript executes.
fixVerify that the HTML element (e.g., `<div id='player-container'></div>`) is correctly defined in your `index.html` or similar file, and that your JavaScript code is executed after the DOM is fully loaded (e.g., within a `DOMContentLoaded` listener or at the end of `<body>`).
Failed to construct 'Player': 'key' is missing from config.
The `bitmovin-player` instance was initialized without a valid license key in its configuration object, which is mandatory for the player to function.
fixProvide a valid Bitmovin Player license key in your `playerConfig` object, typically obtained from your Bitmovin dashboard. For production, consider using environment variables for security (`process.env.BITMOVIN_PLAYER_KEY`).
Audit
Dependencies
bitmovin-playerrequiredThe UI framework is built to integrate with and requires a Bitmovin Player instance (specifically v8.x.x) to function.