Phenix Video.js plugin
Phenix provides integration of the popular web video player video.js with the Phenix Web SDK.
If you have a product that already uses video.js and want to take advantage of the many features of the Phenix platform without switching players, the new Phenix video.js plugin allows you to do so without making major changes to your current player.
An application that uses the video.js player and has access to compatible versions of the
phenixrts-sdk and the phenixrts-sdk-plugin can register the phenixrts-sdk-plugin to the
video.js using https://docs.videojs.com/plugin#.registerPlugin
.
When the application is provided a valid viewing token and the application provides other parameters if needed (e.g., an HLS/DASH player if streaming/on-demand is also supported), the video.js player will subscribe to the channel and play the Phenix stream.
Dependencies
Your version of video.js must be the latest GA (version 8.17.3).
In addition, be sure to install version 2024.2.1 of the Phenix plugin,
as you may encounter an error prompting you to update the @phenixrts/sdk
if version 2024.2.1 of @phenixrts/sdk
is not installed.
Integration
Follow the instructions at our NPM repository.
An overview of the steps is shown below.
Setup
- Install phenix RTS SDK VideoJs plugin
bash
npm i @phenixrts/video-js-plugin
- Install phenix RTS SDK
bash
npm i @phenixrts/sdk
- Initialize videojs with phenix RTS SDK VideoJs plugin
JavaScript
import videojs from 'video.js'; import PhenixRtsVideoJsPlugin from '@phenixrts/video-js-plugin'; ... videojs.registerPlugin('PhenixRtsSdkPlugin', PhenixRtsVideoJsPlugin); videojs('my-video', {...}, function onPlayerReady() { const phenixrts = this.PhenixRtsSdkPlugin({ token: 'DIGEST:....' // PhenixRTS edge token }); ... });
Run the example
- Publish a stream via Phenix RTS Portal.
- Make sure you are in the
examples
folder. - Start the example with:
bash
npm run start
- Create a viewing token using the Phenix RTS Portal.
- Go to Channels
- Select the channel in which the stream was published
- Go to the EdgeAuth tab
- Copy the viewing token
- Open the locally served URL and add a 'token' query parameter and the previously generated token at the end:
http://127.0.0.1:5173/phenixrts-sdk-plugin-for-real-time.html?token=<viewToken>
.