Plugin | Live View | Playback |
---|---|---|
Electronic magnifying glass | √ | √ |
Full screen | √ | √ |
Screenshot | √ | √ |
Manual Mosaic | √ | √ |
Video information | √ | √ |
Live view delay monitoring | √ | - |
Play frame by frame | - | √ |
All functions are mounted on player.pluginMap. The playback plug-ins are also uniformly mounted on the outer player historyPlayer.pluginMap, and there is no need to call methods in the channel player. Different from live view, when playback calls a method of a channel, you need to pass in an additional parameter channelIndex (channel index, starting from 0, not the channel number) or channel object {devId, channel} in the method. If you do not pass the channel index, it takes effect on all channels.
Usage: Take turning on the electronic magnifying glass as an example
Live view:
Playback:
describe
Hold down the left mouse button in the video, select the range, and then release it. The selected range will be enlarged and displayed.
interface
Turn on the magnifying glass
player.pluginMap.magnifier.enable(channelIndex?);
Disable magnifying glass
player.pluginMap.magnifier.disable(channelIndex?);
Cancel the magnifying glass
player.pluginMap.magnifier.cancelZoomIn(channelIndex?);
Note: channelIndex is the channel index or channel object {devId, channel}. Live view does not have this parameter. If the playback is not filled in, it will take effect on all channels.
Example
describe
Display the video screen in full screen.
Note: This plug-in will only display the video screen in full screen. If the business layer also needs to display control buttons or other UI components in full screen, please implement the full screen function by yourself.
interface
full screen
player.pluginMap.fullscreen.fullscreen();
Cancel full screen
player.pluginMap.fullscreen.cancelFullscreen();
Note: channelIndex is the playback player channel index or channel object {devId, channel}, and live view does not have this parameter.
Example
describe
Capture video images, including video images, ADAS overlay, DMS overlay, and mosaic effects.
interface
const base64Datas = player.pluginMap.snapshot.capture(options?);
Parameters
Attribute value | Data type | Description |
---|---|---|
options | object | Optional parameters, control screenshot behavior |
├fileName | string | Optional parameter, the file name of the downloaded image, if not filled in, it will be named with the timestamp |
├autodownload | boolean | Optional parameter, whether to automatically download screenshots, default false |
const base64Datas = player.pluginMap.snapshot.capture(channelIndex?,[, options]);
Parameters
Attribute value | Data type | Description |
---|---|---|
channelIndex | object[] | Required parameter, which can be channel index or channel object { devId, channel }. There is no such parameter for live view. If the playback is null , it will take effect on all channels |
options | object | Optional parameters, control screenshot behavior |
├fileName | string | Optional parameter, the file name of the downloaded image, if not filled in, it will be named with the timestamp |
├autodownload | boolean | Optional parameter, whether to automatically download screenshots, default false |
return value
Attribute value | Data type | Description |
---|---|---|
base64Datas | object[] | Array with base64 data of the current screenshot |
├channel | number | channel number |
├devId | string | device id |
├base64 | string | base64 data |
Example
describe
During video playback, fixed-position mosaics can be added manually.
interface
Edit mosaic
player.pluginMap.codemosiac.editMosiac(channelIndex?);
Save mosaic
player.pluginMap.codemosiac.saveMosiac(channelIndex?);
Clear mosaics
player.pluginMap.codemosiac.clearMosiac(channelIndex?);
Get mosaic data
player.pluginMap.codemosiac.getData(channelInfo[]);
Return value: mosaicData[]
Set mosaic data
player.pluginMap.codemosiac.setData(mosaicData[]);
Delete mosaic
player.pluginMap.codemosiac.clearData(channelInfo[]);
Note: channelIndex is the channel index or channel object {devId, channel}. Live view does not have this parameter. If the playback is not filled in, it will take effect on all channels. For getData and clearData methods, channelInfo is required.
Mosaic data structure:
Example
describe
Displays the resolution, bit rate, and frame rate information of the video. Displayed in the lower right corner of the video.
interface
data parameters:
Example
describe
Used to detect whether there is delay in live view and give a callback. Only the live view scene plug-in takes effect.
interface
parameter
Properties | Type | Description |
---|---|---|
interval | number | Unit: milliseconds. onMessage callback interval. |
delayTime | number | Unit: milliseconds. Delay judgment length, for example, set to 5000, if there is a delay of 5000ms during playback, onMessage will be called back |
onMessage | function | Delayed callback function, no parameters. |
Enable delay plugin
player.pluginMap.liveDelay.enable()
Turn off delay plugin
player.pluginMap.liveDelay.disable();
Example
Version
V1.4.0 or above
describe
Generally used to select the desired frame when playing back screenshots.
This function is only available for playback.
interface
next frame
player.pluginMap.framePlay.nextFrame(step: number = 1);
previous frame
player.pluginMap.framePlay.prevFrame(step: number = 1);
Example