Browser plugins to Browsers and Connected TV SDK 5.x Migration Guide
Video Agent
Video Agent events
The Browsers and Connected TV SDK 5 supports all the VideoAgent events present in the PPAPI/NPAPI plugins, these are now registered directly against the player instance using a listener e.g. player.on("event", () =>{}).
VideoAgent events support:
abortcanplaycanplaythroughdurationchangeemptiedendederrorloadedmetadataloadstartpauseplayplayingprogressseekedseekingstalledtimeupdatevolumechangewaiting
Video Agent properties
All VideoAgent properties are now functions against the player instance object.
Property | Function | Notes |
|---|---|---|
|
| |
|
| |
|
| |
|
| |
| Not implemented | |
|
| |
|
| |
|
| |
|
| Deprecated, see |
|
| |
|
| |
| ||
| ||
|
| |
|
| |
|
| Returns a |
|
| |
|
| |
|
| |
|
| |
|
|
Playback Agent
Track selection
The activateTrack and deactivateTrack methods do not have direct mappings in the Browser SDK. Track selection and deselection is now handled by iterating over a TextTrackList or AudioTrackList returned by the textTracks() and audioTracks() methods.
This is an example of selecting English subtitles:
let tracks = player.textTracks();
for (let i = 0; i < tracks.length; i++) {
let track = tracks[i];
// Show the English subtitle track, disable all others
if (track.kind === "subtitles" && track.language === "en") {
track.mode = "showing";
} else {
track.mode = "disabled";
}
}
Playback Agent events
Plugin event | Browser event | Notes |
|---|---|---|
| Not implemented | |
| Not implemented | |
| ||
|
| These events are implemented in |
Playback Agent properties
Property | Mapping | Notes |
|---|---|---|
|
| The track list returned is not compatible |
|
| The track list returned is not compatible |
Network Agent
Network Agent events
Event | Object | Event |
|---|---|---|
|
|
|
player.otvtoolkit().networkStatistics.setNetworkListener({
selectedBitrateChanged: () => {
console.log("Selected bitrate changed");
}
});