Interface description
The following describes the sound monitoring API of the cmsv6player.min.js plug- in. Support PC/mobile browser.
The plug- in needs to be loaded before use, see: Initialize plug- in
Start listening
startListen(jsession, devIdno, channel)
| Parameter name | Parameter type | Must | Example | Parameter meaning |
|---|---|---|---|---|
| jsession | string | Yes | 66d754dd7f41473dbd2 | Session number returned by user login |
| devIdno | string | Yes | 013300000001 | Device# |
| channel | number | Yes | 0 | Device channel (starting from 0) |
Stop listening
stopListen()
| Parameter name | Parameter type | Must | Example | Parameter meaning |
|---|---|---|---|---|
| None | None | None | None | None |
Listen to callback events
Parameter Type Definition
| Parameter name | Parameter meaning |
|---|---|
| startListen | Start listening |
| stopListen | Stop listening |
| listenNetError | Network exception |
| playListen | Listening |
| loadListen | Waiting for request listening |
| listenStreamNotFound | Waiting for request listening |
| listenStreamStop | Waiting for request listening |
Use Example
See also: https://v7.cmsv8.com/808gps/open/player/video-demo.html
https://v7.cmsv8.com/808gps/open/player/videoExampleH5.html?lang=en
https://v7.cmsv8.com/808gps/open/player/RealPlayVideo.html?account=cmsv6&password=cmsv6&PlateNum=S66666&lang=en
https://v7.cmsv8.com/808gps/open/player/RealPlayVideo.html?jsession=66d754dd7f41473dbd2&PlateNum=S66666&lang=en
Sample code
// cannot be called until initialization is completed
// Start listening
function startMonitor() {
// Start listening
cmsv6player.startListen("66d754dd7f41473dbd2", "devIdno", 0);
}
// Stop listening
function stopMonitor() {
cmsv6player.stopListen();
}
// Video callback event- the video plug- in directly calls the onTtxVideoMsg interface.
function onTtxVideoMsg(index,type) {
if(type == "startListen") {
// Start listening
} else if (type == "stopListen") {
// Stop listening
} else if (type == "listenNetError") {
// Network exception
} else if (type == "playListen") {
// Listening
} else if (type == "loadListen") {
// Loading listener
} else if (type == "listenStreamNotFound") {
// No corresponding sound listening stream
} else if (type == "listenStreamStop") {
// Sound monitoring stops
}
}