Updated on 2024-11-15 GMT+08:00

SDK Usage

  1. Create a container.

    <body>
        <div id='preview' style='width:1280px; height:720px'>
        </div>
    </body>

  2. Create a client by referring to createClient.

    const client = HWLLSPlayer.createClient()

  3. Enter the stream URL and container ID to start playback. See startPlay.

    const streamUrl = 'webrtc://domain/appname/streamname'
    client.startPlay(streamUrl, {
        elementId: 'preview', // (Mandatory) Container ID. Generally, the ID of the div tag is transferred. Here, the ID of the div container in step 1 is entered.
    })

  4. Stop the playback by referring to stopPlay.

    client.stopPlay()

  5. Release resources by referring to destroyClient.

    client.destroyClient()

    See Advanced Usage.