Esempio n. 1
0
        /// <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);
        }
Esempio n. 2
0
 public static string ToStreamingLibrary(this StreamingLibrary streamingLibrary)
 {
     return(streamingLibrary switch
     {
         StreamingLibrary.Hls => "Hls",
         StreamingLibrary.Dash => "Dash",
         _ => "Html5",
     });