Dash-Industry-Forum / dash.js

A reference client implementation for the playback of MPEG DASH via Javascript and compliant browsers.
http://reference.dashif.org/dash.js/nightly/samples/dash-if-reference-player/index.html
Other
5.09k stars 1.67k forks source link

VideoJS 7.15.4 - intermittent 403s when using RequestModifier for MpegDash #3790

Closed andygr closed 2 years ago

andygr commented 2 years ago
Environment
Steps to reproduce
  1. Open the player with Chrome and Safari and click play
  2. Sometimes the response is 200 but sometimes is 403. The init.mp4 doesn't have the appropriate query parameters. However with Firefox v93.0 is working as expected
Observed behavior

I have a cloudfront distribution with pre-signed URLs and I am trying to use VideoJS to be able to attach the policy in each request, instead of using signed cookies. For this task I am using custom pre-signed URLs. I have seen in one of the existing issues a suggestion to use videojs.Html5DashJS.hook('beforeinitialize', (player, mediaPlayer) which I tested with 3 different browsers.

I had some intermittent issues with Safari and Chrome but Firefox (v93) seems to be more stable. I pasted the player code in the bottom of the ticket.

Console output
Paste the contents of the browser console here.
You may need to enable debug logging in dash.js by calling player.updateSettings({ 'debug': { 'logLevel': dashjs.Debug.LOG_LEVEL_DEBUG }}) if you are using your own page.

I attached 2 links where you can see the requests with 200 (when is working) and with 403 by using Chrome

https://cosmonetpublic.s3.eu-west-2.amazonaws.com/play.png https://cosmonetpublic.s3.eu-west-2.amazonaws.com/error.png

Expected behavior

I am expecting to see the Mpeg Dash URL with the Cloudfront policy in each request (for mpd, init and video/audio files)

dsilhavy commented 2 years ago

We are not maintaining the video.js library, an example on how to use the requestModifier with plain dash.js can be found here: https://reference.dashif.org/dash.js/nightly/samples/advanced/extend.html Please check if you can reproduce the problem using only dash.js.

andygr commented 2 years ago

@dsilhavy , thank you for the recommendation. I modified the player, based on the example, and seems to be more stable. I tried all available browsers with Mac and I haven't seen any issue. I will also include Windows PCs.

Generally having the MPD URL and query parameters in different places, seems to be more tidy and flexible.

Regards Andrew

andygr commented 2 years ago

@dsilhavy , can I stream HLS with the same library?

dsilhavy commented 2 years ago

dash.js does not support HLS. video.js supports HLS afaik

andygr commented 2 years ago

do you know if I can use requestModifier with HLS?