Page Content
Phenix Bitmovin Plugin
This page shows how to use the Phenix plugin to play a Phenix stream with the Bitmovin player.
Dependencies
Install the following dependencies using npm install
.
-
@bitmovin/player-web-x : 10.0.0-beta.14
-
@phenixrts/sdk : 2024.2.1
-
@phenixrts/bitmovin-plugin : ^2024.2.1
Usage
- Publish to a channel and create a viewing token in the Phenix Customer Portal.
- Create an index.js file as shown below, and replace
VIEWING_TOKEN
with the token created in the Portal.
JavaScript
import {Player} from '@bitmovin/player-web-x/bundles/playerx-core';
import {SourcePackage} from '@bitmovin/player-web-x/packages/playerx-source.package';
import {SourcesApiPackage} from '@bitmovin/player-web-x/packages/playerx-sources-api.package';
import {PhenixSdkApi} from '@phenixrts/bitmovin-plugin/packages/phenix-sdk-api';
import {PhenixSdkPlugin} from '@phenixrts/bitmovin-plugin/packages/phenix-sdk-plugin';
const playerContainer = document.getElementById('player-container'); // player-container is div with id 'player-container' that will have video element
//const player = Player(playerContainer, {key: <key>});
const player = Player(playerContainer, {key: 'BITMOVIN_LICENSE_KEY'});
const token = "DIGEST:..."
player.packages.add(SourcePackage);
player.packages.add(SourcesApiPackage);
player.packages.add(PhenixSdkApi);
player.packages.add(PhenixSdkPlugin);
const channel = player.phenixrts.createChannel(token);
- Replace
BITMOVIN_LICENSE_KEY
with your Bitmovin license key obtained from your Bitmovin account. - Use a packager to package the project; for example, using parcel the command is:
npx parcel index.js
- Open the url that is printed in the console to view the player and your stream.
References
v2024-09-25T15:41:28.000Z