PS5 Player
FLPlayer for PS5 is built on top of Sony's Universal Video Player (UVP) and abstracts the integration with UVP and exposes the same API surface as the Web player.
Setup
Include the sce-uvp.esm.js Module in the JavaScript source program.
import SceUvp from './sce-uvp.esm.js';
Include UVP css and dash.js
<link href="sce-uvp.css" rel="stylesheet" type="text/css">
<link href="sce-uvp-controls.css" rel="stylesheet" type="text/css">
<script src="dash.js" type="application/javascript">
UVP support the dash.js included in the UVP bundle; public versions of the same library is not supported.
Create the Player
A Player could be built by providing content url, license url and or by providing all the options as below. The UVP
player instance must be passed to the builder via .usePlayer()
method.
import SceUvp from './sce-uvp.esm.js';
const contentUrl =
'https://storage.googleapis.com/shaka-demo-assets/angel-one-widevine/dash.mpd';
const licenseUrl = 'https://cwip-shaka-proxy.appspot.com/no_auth';
const playerBuilder = flPlatformPlayer.createUVPPlayerBuilder();
const player = playerBuilder
.mediaWrapperElement(videoRoot)
.usePlayer(flPlayer.ExternalPlayer.UVPPlayer, SceUvp)
.mediaUrl(contentUrl)
.drmLicenseUrl(licenseUrl)
.drmScheme(flPlayer.DrmScheme.PLAYREADY)
.mediaType(flPlayer.MediaType.DASH)
.logger(configuration.getLogger())
.build();
UVP creates HTMLVideoElement
internally for video rendering, so the builder accepts .mediaWrapperElement()
unlike a regular web player.
Subscribe for events
The application can listen to events such as changes in player state, buffering state, seek state and playback errors by registering a listener/delegate.
player.subscribe('error', function (error) {
console.log('error', error);
});
player.subscribe('contentloaded', function () {
console.log('contentloaded');
});
player.subscribe('playbackstatechanged', function (state) {
console.log('playbackstatechanged', state);
});
Key differences
Playback Configuration
The following playback configuration options are not currently supported on PS5 Player
- Bitrate
- Network configuration
- Buffer configuration
- Trickplay