Description
Create a playback instance
Example
Parameters
domList:
The array of div DOM containers needs to set the width and height of the style, otherwise the video may collapse or other style problems may occur.
options:
Field | Type | Description | Default Value | Required |
---|---|---|---|---|
deviceInfos | object[] | Device information collection | Yes | |
├ devId | string | deviceInfos sub-element field; device unique identifier | Yes | |
├ channels | string | deviceInfos sub-element field; channel number list; the value range of a single channel is 1~32, and multiple channels are separated by commas, such as 1,2,3,4. In virtual playback, channels are Object[] | Yes | |
├ fileIds | string | deviceInfos sub-element field; file id, multiple separated by commas. | Yes | |
beginTime | string | Playback start time: yyyy-mm-dd hh:mm:ss | Yes | |
endTime | string | Playback end time: yyyy-mm-dd hh:mm:ss | Yes | |
streamType | string | Stream type: MAJOR: main stream; MINOR: sub-stream; | MAJOR | No |
storeType | string | Storage type: MASTER: main storage BACKUP: sub-storage; CENTER: central storage | MASTER | No |
hasEncrypt | number | AES decryption type: 0 platform decryption; 1 front-end decryption | 0 | No |
mediaProtocol | string | Media protocol: HTTP_FLV; WS_FLV; New in 1.3.9 ; initial |
HTTP_FLV | No |
hasAudio | number | Whether to carry audio, audio is turned on by default: 0: not carried 1: carried | 1 | No |
timeZoneOffset | number | Time zone offset: plus or minus minutes | 0 | No |
platformTimeZoneOffset | number | Platform time zone offset: plus or minus minutes. Theoretically, like timeZoneOffset, this parameter is mainly used for time zone processing inside the player, and this parameter will be used first. (If the platform time zone is not 0 and no timeZoneOffset parameter is passed, be sure to set platformTimeZoneOffset) | 0 | No |
optId | string | Business operation id, which can be used to operate trace records, etc. | No | |
expireTime | number | Address expiration time, default is 20 seconds | 20 | No |
hasTranscode | number | Whether H265 video transcoding is required, it will be transcoded by default: 0 => no transcoding, 1 => transcoding | 0 | No |
playType | string | Playback type: device: device playback; server: server playback; virServer: virtual playback; mixPlay: fusion playback; | device | No |
fileIds | string | File id, multiple file ids comma concatenation (required for server playback) | No | |
useFileUuid | number | Whether to use uuid. 0 - use fileId (default), 1 - use fileUuid. Please confirm with the interface provider first. Used for server replay. | 1 | No |
blurInterval | number | timeList The segments of the same channel are merged into one segment at the allowed interval; unit (s) | 1 | No |
keyFrame | number | Key frame playback; 1: on, 0: off | 0 | No |
fileList | Object[] | Recording file information list, required in fusion playback mode , non-required items in sub-elements default to parameters filled in by the outer layer (data source: S17 calendar retrieval) |
No | |
├ chan | number | Channel number, starting from 1 | No | |
├ streamType | string | Stream type: MAJOR: main stream; MINOR: sub-stream; the default is to fill in the outer parameter streamType | No | |
├ storeType | string | Storage type: MASTER: main storage BACKUP: sub-storage; CENTER: central storage | No | |
├ fileSize | number | file size | No | |
├ beginTime | string | Playback start time: yyyy-mm-dd hh:mm:ss | No | |
├ endTime | string | Playback end time: yyyy-mm-dd hh:mm:ss | No | |
├ fileUuid | string | Server recording file uuid, only server retrieval has this value | No | |
timeList | array | The time information of the channel, indicating the playback sequence of the current channel. Contains channel number, start and end time. For time alignment, please always fill in this parameter to ensure playback time synchronization. (Data source: S17 calendar retrieval) | Yes | |
├ devId | string | device ID | Yes | |
├ chan | number | Channel number, starting from 1 | Yes | |
├ beginTime | string | Playback start time: yyyy-mm-dd hh:mm:ss | Yes | |
├ endTime | string | Playback end time: yyyy-mm-dd hh:mm:ss | Yes | |
├ streamType | string | Stream type: MAJOR: main stream; MINOR: sub-stream; the default is to fill in the outer parameter streamType | No | |
├ pickFrame | number | Whether to pick frames for playback, required for pick frame playback. It can be obtained from the evidence details interface. | No | |
├ pickFrameInterval | number | Frame picking interval, required for frame picking playback. It can be obtained from the evidence details interface. | No | |
addrType | number | Address type: 1: External network address; 2: Intranet address; | No | |
seekTimeout | string | The time to wait for successful seek. Unit: seconds. | 60 | No |
historyCacheSize | Number | Specify the maximum cache (MB) of historical cache data after playback is completed; the minimum is 500MB, if it is insufficient, use 500MB | 1024 | No |
futureCacheTime | Number | The maximum buffering time (s) of future video data at the current playback time point; | 60 | No |
startMultiple | number | Default playback speed at start. Value range: -4, -2, 1, 2, 4, 8 | 1 | No |
Description
The playback player gets the playback flv address and loads the video stream
Example
Description
Play, resume pause, resume play after stopping
Example
Parameters
Property Value | Type | Description |
---|---|---|
time | String | After stopping, resume playback to the specified time, format: YYYY-MM-DD HH:mm:ss |
Return Value
promise: The first return value obtained in .then or await syntax is Boolean, indicating whether the current operation is successful.
Description
Pause video playback
Example
Return Value
promise: The first return value obtained in .then or await syntax is Boolean, indicating whether the current operation is successful.
Description
Close the playback of the channel with the specified devId
Example
Parameters
Property Value | Type | Description |
---|---|---|
channel | Number | Device channel number |
devId | String | Device id |
Return Value
promise: The first return value obtained in .then or await syntax is Boolean, indicating whether the current operation is successful.
Description
Close the playback of all channels; different from the destroy operation, after calling stopAll to stop all, playback can be resumed through play
Example
Return Value
promise: The first return value obtained in .then or await syntax is Boolean, indicating whether the current operation is successful.
Description
Destroy the channel with the specified devId
Example
Parameters
Property Value | Type | Description |
---|---|---|
channel | Number | Device channel number |
devId | String | Device id |
Return Value
promise: The first return value obtained in .then or await syntax is Boolean, indicating whether the current operation is successful.
Description
Destroy all playback channels
Example
Return Value
promise: The first return value obtained in .then or await syntax is Boolean, indicating whether the current operation is successful.
Description
Get the current cache amount of the channel
Example
Return Value
Property Value | Type | Description |
---|---|---|
cacheInfo | Object[] | Cache information data list |
├ startTime | number | The start time of the current cache segment (utc) |
├ endTime | number | The end time of the current cache segment (utc) |
Description
Jump to play at the specified time, which has the same effect as the setter currentTime, but you can specify whether to play after the seek is successful.
Example
Parameters
Property Value | Type | Description |
---|---|---|
time | String | The time to jump, format: YYYY-MM-DD HH:mm:ss |
autoPlay | Boolean | Whether to automatically play after seek is completed |
Note: This interface cannot be used to resume playback in stopped state. Please call play if you need to resume playback.
Description
Get the channel information of the specified device id + channel number.
Example
Parameters
Property Value | Type | Description |
---|---|---|
devId | String | Device number |
channel | String | Channel number |
Return Value
mediaElement: such as {dom: DOM, devId: 'dev001', channel: '1'}
Attribute Name | Type | Description |
---|---|---|
domObject | Object | Object with dom and channel data |
dom | HTML DOM | The dom (canvas or video) that renders the current video |
devId | String | Device number |
channel | String | Channel number |
Description
Get the current playback time | Set the time to jump
Example
Description
Get the player stream type | Set the switched stream type
Example
Set value range: MAJOR (main stream), MINOR (sub-stream)
Description
Get the volume of each channel of the player | Set the volume of the player channel
Example
Parameters
Property Value | Type | Description | |
---|---|---|---|
volume:Object | devId | String | Device Id |
channel | Number | Device channel number | |
volume | Number | Expected channel volume, range 0 - 1 |
Description
Set player aspect ratio
Example
Set value range: String, full: full, origin: original ratio, ratio mode, such as: 16:9, 4:3, 1:1
Description
Set player playback speed
Example
Set value range: Number, playback speed (-4, -2, 1, 2, 4, 8)
Description
Get the current playback status of the player
Example
Get value status includes:
Description
It needs to be distinguished from the player state. The playback state refers to whether the channel is in the playback state with flow or in the idle state without flow during the playback process.
Example
Get: historyPlayer.PlayerStatus
Get value status includes:
Description
Contains a list of data such as DOM (canvas or video) that renders the current video
Example
Return Value
Property Value | Type | Description |
---|---|---|
channelData | Object[] | Data list |
├ dom | HTML DOM | The dom (canvas or video) that renders the current video |
├ devId | string | Device number |
├ channel | number | Channel number |
Device playback and server playback are allowed at the same time. The same device channel can perform server playback and device playback at the same time, with priority given to server playback.
Used for simultaneous server playback on multiple devices
Note: Special instructions for virtual playback
Virtual playback realizes the possibility of simultaneous playback on multiple devices, which is similar to playing multiple devices into one device (referring to a virtual device).
A certain channel of a certain playing device may have multiple video files, so in order to ensure that the fileId corresponds to the corresponding channel of the device, the channel of deviceInfos is object data.