Skip to content

Direct Playback

Torbjörn Einarson edited this page Oct 18, 2023 · 3 revisions

Some toplevel pages like /urlgen, /assets, and vod include direct URLs that start up a player with the corresponding livesim2 MPD URL.

The basic URL is configured with the option playurl where the actual mediaURL is replacing the pattern %s is in the playurl value. The scheme in the player URL is automatically matched to the scheme of the livesim2 instance.

The default player URL goes to the latest dash.js online

Limitations for HTTP

In general, one should try to run the livesim2 server over HTTPS. With the Let's Encrypt support, it is very easy to set that up given that one has a public IP and a DNS entry pointing to that address.

However, for easy local testing, one may instead use a server running on localhost, like the default http://localhost:8888.

In that case, the player URL will also use the http scheme, and playback should work nicely on Safari (version 16 or older) and Firefox (version 117 and older).

On Chrome (versions from 2022 onward), however, there is a security limitation that disallows local content to be loaded from a networked instance, unless a special CORS header Access-Control-Allow-Private-Network is set. This is discussed here.

This has been added to the Akamai site hosting the dash.js reference client. With this extra header local content (with normal CORS headers) can be played back in a networked dash.js player, but only if that player is served via https. Since other browsers do not support the combination of an https-player and local http content, there is no common way to server local http content from a networked browser player.

To remedy this, livesim2 (from v0.9) proxies the networked browser players when the server runs on http. This works well for dash.js, and should work for other players as well.

Limitations on autoPlay

There are also some limitations on autoPlay. In particular, most browsers do not support automatic play if audio is on.

With dash.js, which has an autoLoad parameter, the loading is often started, without the actual playback. Just pressing the playback button should get you going. However, for true auto playback one should specify the query parameters ?autoLoad=true&muted=true to actually get the playback started automatically.