Interface description
The following describes the API for broadcasting cmsv6player the. min.js plug- in.
The plug- in needs to be loaded before use, see: Initialize plug-in
HTTPS can be broadcast directly; For http broadcasting, PCM audio acquisition tools need to be downloaded and installed.
Audio Capture Tool Download Link: https://v7.cmsv8.com/product/CMSV6PcmTool/CMSV6PcmTool.exe
Start broadcasting
startBroadcast(jsession, lstDevIdnos, channel)
If the global settings have been setServerInfo, the serverIp and serverPort can be left blank.
| Parameter name |
Parameter type |
Must |
Example |
Parameter meaning |
| jsession |
string |
Yes |
66d754dd7f41473dbd2 |
Session number returned by user login |
| lstDevIdnos |
string |
Yes |
013800000001,013800000002 |
Device numbers, multiple device numbers separated by commas |
| channel |
number |
is |
0 |
channel number, pass 0 |
Stop broadcasting
// Stop broadcasting
stopBroadcast()
Broadcast callback events
| Parameter Name |
Parameter Meaning |
| showDownLoadDialog |
Requires PCM audio capture tool download |
| startBroadcast |
Start Broadcast |
| broadcasting |
Broadcast |
| stopBroadcast |
Stop broadcasting |
| requireBroadcast |
Request broadcast |
Sample code
// Set broadcast parameters
cmsv6player.setTalkParam(1);
cmsv6player.setTalkMaxParam(2);
// Start the broadcast
// onTtxVideoMsg the callback message to determine whether type = broadcasting indicates that it is being broadcast, and type = showDownLoadDialog indicates that the PCM collection tool needs to be downloaded.
cmsv6player.startBroadcast("66d754dd7f41473dbd2", "013800000001,013800000002", 0, 127.0.0.1, 6605)
// Stop broadcasting
cmsv6player.stopBroadcast();
// Broadcast events
function onTtxVideoMsg(index,type) {
if(type == "showDownLoadDialog") {
// Need to download PCM audio acquisition tool, not https
} else if(type == "broadcasting") {
// in the broadcast
} else if(type == "startBroadcast") {
// Start Broadcast
} else if (type == "requireBroadcast") {
// Request broadcast
} else if (type == "stopBroadcast ") {
// Stop broadcasting
}
}