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

Support for AES-128 token encryption on video stream. #3846

Open sturlath opened 2 years ago

sturlath commented 2 years ago

Video player can´t play videos with AES token restriction only (no DRM). This is the base protection you need for you video stream if you are not using DRM.

When this works

<iframe src="//aka.ms/ampembed?url=@video.DashUrl&aes=true&token=@video.Token"
        id="azuremediaplayer"
        name="azuremediaplayer"
        scrolling="no"
        frameborder="no"
        align="center"
        height="500px"
        width="672px"
        allowfullscreen
        class="embed-responsive-item"></iframe>

this (or any permutation I tried) doesn´t (of course).

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

Hls.js supports AES-128 token encryption

johndeu commented 2 years ago

If you are hosting a commonly used player framework like HLS.js, DASH.js, Video.js, you have to put the correct format string on the URL. The default URL manifest that comes back from a Live event preview URL is going to be Smooth Streaming format. /manifest

To get HLS, you have to add /manifest(format=m3u8-cmaf) to get an HLS playlist. Some players require you to add the .m3u8 extension to that as well.

To get DASH, you have to add /manifest(format=mpd-time-cmaf) to get an actual DASH MPD manifest. Some players require you to add a .mpd extension to that.

My recommendation... use HLS.js or Dash.js or Video.js and move over to React and Next.js - life will be much easier than Blazor for video stuff.

sturlath commented 2 years ago

Here I´m getting the live stream (Dash in this case) using AES token but the Blazorise Video player can´t play that, or I at least can´t figure it out.

And yes for this video stuff, Blazor is causing me a world of headache! But for now I´ll stick with IFrame since this functionality is not for the massess but just for the streamer to see if the stream is working or not. The front facing app in in .net Razor pages.

sturlath commented 2 years ago

Any change we can also try this out also @stsrki? Not sure if you noticed my link AES-128 token encryption?

and end up with something like this

<Video Source="@video.HlsUrl"
StreamingLibrary="StreamingLibrary.Hls" 
AES ="true"
ProtectionHttpRequestHeaders="@video.Token"/>

At least for the player to be really useful for all scenarios it will need to have token restriction (if you don´t have DRM+token (not AES))