Description
This interface is used to create a live-view player instance.
Example
Parameter Details
domList:
An array of div DOM containers. Make sure to set the width and height styles, otherwise, the video might collapse or have other style issues.
options:
Field | Type | Description | Default Value | Required |
---|---|---|---|---|
deviceInfos | object[] | The collection of device information | Yes | |
├ devId | string | The subfield of deviceInfos. It is the unique device identifier. | Yes | |
├ channels | string | The subfield of deviceInfos. It is the list of channel numbers, separated by commas, e.g., 1,2,3,4. | Yes | |
streamType | string | Stream type: MAJOR (main stream), MINOR (sub-stream) | MAJOR | No |
mediaProtocol | string | Media protocol: HTTP_FLV (effective for S17) | HTTP_FLV | No |
quality | string | Resolution: SMOOTH for smooth, STANDARD for standard, CLARITY for clear (effective for S17) | STANDARD | No |
hasAudio | number | It specifies whether audio is included, with the default setting being audio on. Value range: 0 for no audio, and 1 for audio (effective for S17). | 1 | No |
expireTime | number | The address expiration time (defaults to 20 seconds) (effective for S17) | 20 | No |
hasTranscode | number | It specifies whether the H265 video transcoding is needed, with the default behavior being to transcode. Value range: 0 for no transcoding, and 1 for transcoding (effective for S17). | 0 | No |
playMode | number | Play mode: 0-real-time priority; 1-smooth priority. Effective in MSE decoding mode. Real-time priority is the default strategy, enabling loading when there is no data; Smooth priority uses slow playback strategy when there is less cache to minimize loading causing screen pause. Due to caching requirements, real-time performance is slightly worse. | 0 | No |
Description
S17 takes effect: The device uses AES and other encryption methods for transmission, allowing decryption and play on the H5Player side.
Parameter
Field | Type | Description | Default Value | Required |
---|---|---|---|---|
hasEncrypt | number | The AES decryption type: 0 for platform decryption; 1 for frontend decryption | 0 | No |
Description
S17 takes effect: This parameter is used to record information such as the time recorded during playing after the user accesses s17.
Parameter
Field | Type | Description | Default Value | Required |
---|---|---|---|---|
optId | string | Operation ID, used for operation logging purposes | "" | No |
Description
S17 takes effect: It allows users to access S17 via LAN or WAN.
Parameter
Field | Type | Description | Default Value | Required |
---|---|---|---|---|
addrType | number | Address type: 1 for WAN, 2 for LAN; | 1 | No |
Description
Allow access to multiple video sources
Parameter
Field | Type | Description | Default Value | Required |
---|---|---|---|---|
netRequestType | number | Network request type, 1-S17, 4- Device direct connection (added in V2.0.1) | 1 | No |
Description
Device direct connection takes effect: The scenario of device direct connection requires the integrator to set a key for decryption and playback
Parameter
Field | Type | Description | Default Value | Required |
---|---|---|---|---|
encrypt | object[] | Key information | [] | No |
├ channel | number | Channel information | No | |
├ encryptType | string | Key type,AES/RSA | AES | No |
├ aesParam | object | AES info | No | |
├ aesType | number | AES Encryption type,128、192、256 | 256 | No |
├ aesKey | string | AES Key | No |
Description
The live-view player obtains the FLV play address and loads the video stream.
Example
Description
It allows stopping the play of the specified devId's channel. After the play is stopped, you can call the replay interface to resume play.
If channel is 0 or not provided, all channels of the current device will be stopped.
If no parameters are provided, all devices will be stopped.
Example
Parameter
Property Value | Type | Description |
---|---|---|
object[] | Parameter information | |
|-channel | Number | The device channel number |
|-devId | String | Device ID |
Description
This method is used to destroy the specified devId channel.
If channel is 0 or not provided, all channels of the current device will be destroyed.
If no parameters are provided, all devices will be destroyed.
Example
Parameter
Property Value | Type | Description |
---|---|---|
object[] | Parameter information | |
|-channel | Number | The device channel number |
|-devId | String | Device ID |
Description
After the channel of the specified devId is stopped, this interface can be called to resume play.
Example
Parameter
Property Value | Type | Description |
---|---|---|
object[] | Parameter information | |
|-channel | Number | The device channel number |
|-devId | String | Device ID |
Description
This method is used to add the specified devId channel to the current play instance.
Example
Parameter
Property Value | Type | Description |
---|---|---|
object[] | Parameter information | |
|-channel | Number | The device channel number |
|-devId | String | Device ID |
|-dom | HTMLElement | div DOM container |
Description
This method is used to obtain the rendering-related information through the instance.
Example
Return value
renderInfoList:
Property Name | Type | Description |
---|---|---|
domObject | Object[] | The objects with DOM and the objects with channel data |
├ index | number | The rendering order of the DOMs within the instance |
├ devId | String | Device number |
├ channel | number | The channel number. If it's a virtual playback, it is the virtualized channel number |
├ realChannel | number | The channel number provided by the user |
├ volume | number | The current volume level for the channel |
├ domContainer | HTML DOM | The container div for rendering the DOM |
Description
This method is used to obtain the start time of live-view play, returning the UTC timestamp to the client in milliseconds.
Example
Note: To get the end time, please refer to the afterDestroy hook in HOOKS.
Description
This method is used to obtain the duration of the live-view play (in milliseconds).
Example
Description
This property is used to obtain or set the stream type for the player.
Example
Parameter
Property Value | Type | Description | |
---|---|---|---|
streamType:Object | devId | String | Device ID |
channel | Number | The device channel number | |
streamType | String | Value range: MAJOR (main stream), MINOR (sub-stream) |
Description
This property is used to obtain or set the volume for each channel on the player.
Example
Parameter
Property Value | Type | Description | |
---|---|---|---|
volume:Object | devId | String | Device ID |
channel | Number | The device channel number | |
volume | Number | The expected channel volume level (ranging from 0 to 1). |
Description
This property is used to obtain the current play status of the player.
Example
Possible state values include: