0

I've been trying to setup mpeg dash streaming, but I'm not having much luck. I have the dash.all.debug.js added to the html, but then it asks for a /dash.all.debug.js.map which I found here. But after that, nothing. Clearly something is working because it asked for the map file, but after that neither Chrome nor Firefox do anything. They ask for the mpd, which I give and was verified on a random website, but there are no requests made to the server.

html code is:

 <html>
    <head>
    <script src="dash.all.debug.js"></script>
    <script>
        (function(){
            var url = "http://dash.edgesuite.net/envivio/Envivio-dash2/manifest.mpd";
            var player = dashjs.MediaPlayer().create(); 
            player.initialize(document.querySelector("#videoPlayer"), url, true);
        })();
    </script>
    </head>
    <body>
    <img src="Soranin.jpg" alt="not found" height=500>


    video:
    <video id="videoPlayer" src="media/movies/Demo/video.mpd" type="application/dash+xml"></video>
    </body>
</html>

The console log says

[10] [dash.js 2.6.8] MediaPlayer has been initialized 

so something somewhere has to be working, right? What am I missing?

1 Answer 1

3

There are a couple of problems here.

The main problem is that the querySelector in the script initialising the player returns null because the script runs before the DOM is ready. Move this script to the bottom of the body to solve this, or ensure the script runs when the DOM is ready rather than immediately.

The second is that isn't possible to set the source to DASH manifest and get video playback because most browsers (other than Edge) are not capable of native DASH playback. If it was, you wouldn't need dash.js. Remove the src and type attributes from your video tag, and set the url variable in the initialising script above to your manifest url.

Follow https://github.com/Dash-Industry-Forum/dash.js/#standard-setup for full instructions. There's also a super-easy version where you don't need to write any code: https://github.com/Dash-Industry-Forum/dash.js/#quick-start-for-users.

4
  • Thank you. I followed that and it seemed to work for somebody else's manifest. However, when I put in my manifest, it says "[ScheduleController][ video ] start denied " and the same for audio. It got all the data it needs (I think) so there shouldn't be any issues, right? I'll keep looking though and verifying the entire file was sent.
    – Neywiny
    Commented Apr 19, 2018 at 14:27
  • Yeah I'm trying to get this working and it keeps asking for bytes outside the range of the file and I don't know why. I keep sending back 416 errors until it stops, but then nothing.
    – Neywiny
    Commented Apr 19, 2018 at 22:14
  • The most likely reason the player will be requesting ranges outside the file is if the manifest is incorrect :-) Commented Apr 20, 2018 at 9:37
  • Thanks. That's what I thought but I can't find anywhere in the manifest that specifies the byte length of the file? Like, chrome explicitly asks for a stop after the end in it's requests e.g. "1500-3000/2000" And the duration is correct. Do I need more precise than just seconds?
    – Neywiny
    Commented Apr 21, 2018 at 4:48

Not the answer you're looking for? Browse other questions tagged or ask your own question.