TareqAlqutami / rtmp-hls-server

a docker file to create a streaming server that supports RTMP, HLS and DASH content based on nginx and nginx-rtmp-module.
MIT License
402 stars 193 forks source link

not working for VOD server #14

Open Arraiz opened 3 years ago

Arraiz commented 3 years ago

putting a .mpd in /mnt/dash and then going to the dash route, the playback does not work

TareqAlqutami commented 3 years ago

Can you detail out what you did exactly so I can replicate

JamiePhonic commented 3 years ago

@TareqAlqutami

I've tested this with firefox. There appear to be 2 problems.

  1. If NOT using the FFMPEG nginx config, the name of the dash MPD file is <streamkey>.mpd, not <streamkey>_src.mpd.

  2. In the Firefox developer console, the following message appears: Specified “type” attribute of “application/dash+xml” is not supported. Load of media resource /dash/test_src.mpd failed. This message doesnt show in chromium based browsers like Chrome or Edge, and doesn't seem to really mean anything, but it does go away if you move the src and type attributes into the player <script> block like so:

    <script>
    var player = videojs('#player');
    player.src({ src: '/dash/test_src.mpd', type: 'application/dash+xml'});
    </script>

Checking the "Network" tab, it looks like both browsers (Firefox and Edge Chromium in my case) will load and play the Dash segments from the first test_src.mpd, then just keep requesting test_src.mpd but not the next video segment.

It looks like Video.JS requires 2 addiditonal scripts to be loaded for full DASH support, even though according to Video.JS own documentation, you shouldn't need to because both DASH and HLS support is built in through videojs-http-streaming by default.

  1. The Video.js DASH plugin
  2. The Dash.js library on which the Video.js DASH plugin depends
    <script src="https://vjs.zencdn.net/7.5.5/video.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/videojs-contrib-dash@latest/dist/videojs-dash.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/dashjs@latest/dist/dash.all.min.js"></script>

Hopefully that helps! Source: https://videojs.github.io/videojs-contrib-dash/