Options
All
  • Public
  • Public/Protected
  • All
Menu

Accurate Player ABR API

Accurate Player Abr

Accurate Player implementation using Shaka Player with capabilities to stream HLS and Dash content.

Installation

Install with npm.

npm install --save @accurate-player/accurate-player-core @accurate-player/accurate-player-abr

Example

Below is an example of how you use player in e.g. angular or react.

import { AbrPlayer } from "@accurate-player/accurate-player-abr";

const player = new AbrPlayer(videoElement);
player.api.loadVideoFile({
  src: "https://s3.eu-central-1.amazonaws.com/accurate-player-demo-assets/dash/sintel.mpd",
  enabled: true,
  frameRate: { numerator: 24, denominator: 1 },
  dropFrame: false,
});

Control the player through player.api. E.g.

player.api.play();
player.api.pause();

Troubleshooting

HLS content with MPEG2-TS streams

Many browsers have trouble playing MPEG2-TS streams (only supported in Edge). The ABR player supports transmuxing TS to MP4 on-the-fly so the browser can play it. This is done using the mux.js library (version =>5.6.3). If the player detects that mux.js is loaded it will enable transmuxing.

You can load mux.js by including this script tag on your page:

<script src="https://unpkg.com/mux.js@latest/dist/mux.min.js"></script>

or you may download it using a package manager like npm and include it in your application bundle for example.