Hello,
We are trying to play a stream that includes CDN tokens. If the token is not in the url, the file is forbidden for downloading. For security reasons, I am not able to share you the real url, but here is the example:
If I remove the token from url, the stream will not start, as the manifest is forbidden for downloading:
If I start the stream, then the manifest is downloaded correctly, but as soon as the dashjs starts downloading audio and video chunks then it fails. The reason for this is that the same token should be added into each chunk request URL.
This URL for media chunk fails:
http://.../1-0-alwo-2015/video/video-H264-396-1000k_dashinit.mp4
This URL will download file:
I've tried this:
player.setXHRWithCredentialsForType("MediaSegment", true);
and this:
player.setXHRWithCredentials(true);
Is there any support for this in dashjs or should we modify player according to our needs.
Any help on this will be greatly appreciated! Thanks
You will need to extend the RequestModifier module and add the token to the segment URLs using modifyRequestURL, as described in https://github.com/Dash-Industry-Forum/dash.js/issues/1471#issuecomment-229291235
@herrsiim, two alternative approaches commonly used that avoids you to extend the client:
Closing this one. @herrsiim, please feel free to reopen this one in case something is not clear.
Most helpful comment
@herrsiim, two alternative approaches commonly used that avoids you to extend the client: