Example #1
0
 /// <summary>
 /// method Open Full Screen
 /// </summary>
 public async void OpenFullScreen()
 {
     // Verify the JSRunTime is available else this won't work.
     if (HasJSRunTime)
     {
         await BlazorJSBridge.OpenFullScreen(jsRuntime : this.JSRunTime);
     }
 }
Example #2
0
        /// <summary>
        /// This method returns the Current Time
        /// </summary>
        public async Task <int> GetCurrentTime()
        {
            // initial value
            int currentTime = 0;

            // if the value for HasJSRunTime is true
            if (HasJSRunTime)
            {
                // get the currentTime
                currentTime = await BlazorJSBridge.GetCurrentTime(this.JSRunTime);
            }

            // return value
            return(currentTime);
        }
Example #3
0
        /// <summary>
        /// method Play Or Pause
        /// </summary>
        public async void PlayOrPause()
        {
            // local
            double duration = 0;

            // if the value for HasJSRunTime is true
            if (HasJSRunTime)
            {
                await BlazorJSBridge.PlayOrPause(jsRuntime : this.JSRunTime);

                // Toggle
                Playing = !Playing;

                // if we are playing but the Label is not hooked up
                if (Playing)
                {
                    // if the Label has not been hooked yet
                    if (!LabelHooked)
                    {
                        await BlazorJSBridge.TimeMonitor(this.JSRunTime);

                        // get the duration of the video
                        duration = await BlazorJSBridge.GetVideoDuration(this.JSRunTime);

                        // Format the display time
                        VideoDuration = "/" + TimeHelper.FormatDisplayTime(duration);

                        // The Label has been hooked up
                        LabelHooked = true;
                    }
                }

                // Ensure UI Updates
                StateHasChanged();
            }
        }