/// <inheritdoc/> protected override async Task OnAfterRenderAsync(bool firstRender) { if (firstRender) { await JSModule.Initialize(DotNetObjectRef, ElementRef, ElementId, new { Controls, AutomaticallyHideControls, AutoPlay, AutoPause, Muted, Source, Poster, StreamingLibrary = StreamingLibrary.ToStreamingLibrary(), SeekTime, CurrentTime, Volume, ClickToPlay, DisableContextMenu, ResetOnEnd, Ratio, InvertTime, Protection = ProtectionType != VideoProtectionType.None ? new { Data = ProtectionData, Type = ProtectionType.ToVideoProtectionType(), ServerUrl = ProtectionServerUrl, HttpRequestHeaders = ProtectionHttpRequestHeaders } : null }); } await base.OnAfterRenderAsync(firstRender); }
public static string ToStreamingLibrary(this StreamingLibrary streamingLibrary) { return(streamingLibrary switch { StreamingLibrary.Hls => "Hls", StreamingLibrary.Dash => "Dash", _ => "Html5", });