mpeg-dashdash.js

dash.js can't play multiple videos one after the other


I'm trying to use dash.js to play some mpeg-dash videos one after the other using the same dash object. I will initialize things like so:

var dashPlayer = dashjs.MediaPlayer().create();

Then I will initialize it with my first video like:

dashPlayer.initialize(document.getElementById('dashvideoelement'), 'https:urltompegdashvideosource', true);

This will cause the video to play the way I want. Once it is over, I would like to reuse this object to play a new video, but subsequent initializations with different url sources do nothing, even if I call reset() on the object, where if I then initialize and try play(), I get

Uncaught You must first call initialize() and set a valid source and view before calling this method

Is it not possible to reuse the dash.js object to play different videos? This happens on dash.js versions 3.2.2 and 4.0.1.

Thank you.


Solution

  • Can you please check version 4.1.0. We fixed this here: https://github.com/Dash-Industry-Forum/dash.js/pull/3735. A nightly build of dash.js is available here: https://reference.dashif.org/dash.js/nightly/samples/dash-if-reference-player/index.html