Skip to content

Direct Playback

Torbjörn Einarson edited this page Sep 26, 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 seems to be a security limitation that disallows local content to be loaded from a networked instance. This is discussed here.

The error message seen could look like:

Access to XMLHttpRequest at 'http://localhost:8888/livesim2/testpic_2s/Manifest.mpd' from origin 'http://reference.dashif.org' has been blocked by CORS policy: The request client is not a secure context and the resource is in more-private address space `local`.

It is currently unclear how to get around this, but setting an extra CORS header Access-Control-Allow-Private-Network in the livesim2 response does not seem to be enough, since the request is not even done.

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.

Clone this wiki locally