Updated on 2025-02-21 GMT+08:00
SDK Usage
- Create a container.
<body> <div id='preview' style='width:1280px; height:720px'> </div> </body> - Create a client by referring to createClient.
const client = HWLLSPlayer.createClient()
- 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. }) client.on('Error', (errorInfo)=>{ // Listen on and handle playback errors. console.log(`Something error: ${errorInfo.getMsg()}`) })For details about the error, see Client Error Codes.
- Stop the playback by referring to stopPlay.
client.stopPlay()
- Release resources by referring to destroyClient.
client.destroyClient()
See Advanced Usage.
Parent topic: Web SDK
What is your overall rating for this page?
0
1
2
3
4
5
6
7
8
9
10
Very dissatisfiedVery satisfied
Thank you very much for your feedback. We will continue working to improve the documentation.
The system is busy. Please try again later.