Megabit / Blazorise

Blazorise is a component library built on top of Blazor with support for CSS frameworks like Bootstrap, Tailwind, Bulma, AntDesign, and Material.
https://blazorise.com/
Other
3.29k stars 530 forks source link

ProtectionHttpRequestHeaders isn't applied for video player when playing EAS stream #4551

Open sturlath opened 1 year ago

sturlath commented 1 year ago

If I try to setup and play a stream that is DASH with AES token the token isn´t applied.

<Video Source="@Video.DashUrl"
 StreamingLibrary="StreamingLibrary.Dash"
 ProtectionHttpRequestHeaders="@Video.Token" />

I just get a 400 error and a url that looks like this https://myserver-euno.streaming.media.azure.net/27531r60-8b40-4fef-b158-e00bd3ba45fc/96d76c64-3d5d-5255-8972-83cc89ed110e.ism/manifest(format=mpd-time-csf,encryption=cbc)&aes=true

As you can see there is no token being applied at the end. The stream is just fine and if I add the link to https://ampdemo.azureedge.net/ and add the token it just plays fine.

Update: I had forgotten I had asked this question before 🙄

sturlath commented 1 year ago

I found this conversation we had @stsrki and I have been trying to get it to work but I just can´t get the token to show up.

Any ideas?

sturlath commented 1 year ago

I have been trying to load the Blazorise project so I can debug this and maybe do a PR but what ever I do VS just hangs.. funnily enough on the loading indicator project 😂 image

Any tips for me @stsrki if I manage to load it?

stsrki commented 1 year ago

That can happen sometimes but usually restart helps. Are you on latest VS? We use VS preview for the development.

sturlath commented 1 year ago

Yes I only use preview. Updated and restarted but still no go.. will try some stuff.

But regarding the issue, its a bug right? It should provide the token? If so Ill try to fix it.

stsrki commented 1 year ago

I haven't tried it so far, but I would say yes.

sturlath commented 1 year ago

OK finally managed to load it.. for others later go to %USERPROFILE%\AppData\Local\Microsoft\VisualStudio and delete all the cache folders there.

I´ll start looking into the issue btw.

sturlath commented 1 year ago

I figured out the issue (I think). You are applying the protection data if there is any VideoProtectionType set.

image

but I'm not using any DRM this time, just AES encryption.

<Video Source="@Video.DashUrl"
 StreamingLibrary="StreamingLibrary.Dash"
 ProtectionHttpRequestHeaders="@Video.Token" />

And thats the reason Protectionpart is never set.

I tried these steps without the token being set anywhere.

What am I missing?

sturlath commented 1 year ago

OK looks like dash.js doesn´t support AES...

I´m little confused now... It looks like we can play the DASH video stream with hls.js.. will look at this..

FYI I´m trying to figure this all out in this small demo. using hls.js.