Pause an HTTP Live Stream Video.
The CSS3 Selector of the VIDEO element to pause.
If the video element was created by PlayHLS with "_new" parameter, you should also use "_new" in this argument.
If you are unfamiliar with CSS3 Selectors have a look in Finding the correct CSS3 Selector article.
Pause an HTTP Live Stream Video.
Visual Basic |
---|
Public Sub PauseHLS( _ ByVal Selector As String _ ) |
The CSS3 Selector of the VIDEO element to pause.
If the video element was created by PlayHLS with "_new" parameter, you should also use "_new" in this argument.
If you are unfamiliar with CSS3 Selectors have a look in Finding the correct CSS3 Selector article.
Option Explicit Private Sub Form_Load() WebKitX1.EnableHighDPISupport End Sub Private Sub Form_Resize() On Error Resume Next WebKitX1.Move 0, 0, ScaleWidth, ScaleHeight - Text1.Height Text1.Move 0, ScaleHeight - Text1.Height, ScaleWidth, Text1.Height Err.Clear End Sub Private Sub mnuDevTools_Click() WebKitX1.ShowDevTools 0 End Sub Private Sub WebKitX1_OnCreate(ByVal Settings As WebKitXCEF3Lib.ISettings, CommandLineSwitches As String) Settings.plugins = False Settings.cache_path = App.Path + "\MyCache" Settings.application_cache = App.Path + "\MyAppCache" Settings.persist_session_cookies = 1 Settings.persist_user_preferences = 1 Settings.enable_high_dpi_support = True Settings.user_agent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36" CommandLineSwitches = "--autoplay-policy=no-user-gesture-required" End Sub Private Sub WebKitX1_OnBrowserReady() Dim Options As New HLSSettings Options.debug = True Options.Controls = True WebKitX1.PlayHLS "_new", "https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8", Options End Sub Private Sub mnuPlay_Click() WebKitX1.PlayHLS "_new", "", Nothing End Sub Private Sub mnuPause_Click() WebKitX1.PauseHLS "_new" End Sub Private Sub WebKitX1_OnConsoleMessage(ByVal ConsoleMessage As String, ByVal Source As String, ByVal Line As Long) Text1.Text = Text1.Text + ConsoleMessage + vbCrLf Text1.SelStart = Len(Text1.Text) End Sub