mobileFX WebKitX CEF3 ActiveX 4.x
WebKitXCEF3Lib ActiveX Control / WebKitXCEF3 Object / PauseHLS Method

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.

In This Topic
    PauseHLS Method
    In This Topic
    Description

    Pause an HTTP Live Stream Video.

    Syntax
    Visual Basic
    Public Sub PauseHLS( _
       ByVal Selector As String _
    ) 
    Parameters
    Selector

    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.

    Remarks
    WebKitX wraps HLS.js in order to offer HTTP Live Stream. HLS.js is a JavaScript library which implements an HTTP Live Streaming client. It relies on HTML5 video and MediaSource Extensions for playback. It works by transmuxing MPEG-2 Transport Stream and AAC/MP3 streams into ISO BMFF (MP4) fragments.
    Example
    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
    See Also