bonc-htmlplayer
Advanced tools
Comparing version 1.0.12 to 1.0.13
{ | ||
"name": "bonc-htmlplayer", | ||
"version": "1.0.12", | ||
"version": "1.0.13", | ||
"description": "东方国信的html播放器内核", | ||
@@ -5,0 +5,0 @@ "main": "./src/index.js", |
@@ -146,2 +146,48 @@ | ||
|imgInfo |抛出人脸序列的回调|e:人脸数据,类型ArrayBuffer | ||
|onRecordInfo | 查询录像结果的回调 | info:{Response:{ChannelID: "f8785be0cfe440b4bf37c53a90604fd6-0000"CmdType: "RecordInfo",RecordList:{item:[]},SumNum:"345"}} | ||
## 视频回放的相关方法 | ||
1.绑定onRecordInfo的回调 | ||
2.执行searchRecord,其中startTime和endTime相差不得超过3天,否则服务端直接拒绝查询,不会返回任何信息 | ||
3.等待查询返回结果 | ||
4.执行播放视频的方法playRecord | ||
### searchRecord(params) 查询录像 | ||
``` | ||
var params ={ | ||
channelId: "f8785be0cfe440b4bf37c53a90604fd6-0000", | ||
endTime: "11/25/2020, 10:46:07 AM", | ||
startTime: "11/24/2020, 2:46:07 PM", | ||
streamServerIP: "172.16.96.165", | ||
streamServerPort: "10090", | ||
} | ||
searchRecord(params) | ||
``` | ||
### playRecord(params) 播放录像 | ||
``` | ||
var params = { | ||
channelId: "f8785be0cfe440b4bf37c53a90604fd6-0000" | ||
endTime: 1606272367 | ||
index: 0 | ||
speed: 1 | ||
startTime: 1606211353 | ||
} | ||
playRecord(params) | ||
``` | ||
### pause() 暂停播放 | ||
### download(info) 下载 | ||
``` | ||
var info = { | ||
startTime: Number, //时间戳 秒 | ||
endTime: Number, //时间戳 秒 | ||
ip:String, // 回放服务器的ip地址 | ||
port : String, // 回放服务的端口号 | ||
filename :String, // 保存的文件名 | ||
channelId :String, // 通道id | ||
} | ||
``` |
@@ -167,2 +167,19 @@ import Event from './util/event'; | ||
/** | ||
* 下载视频 | ||
* @param { | ||
* } info | ||
*/ | ||
download(info){ | ||
var {startTime,endTime,ip,port,filename,channelId} = info | ||
var url = `http://${ip}:${port}/${filename}.flv?channelid=${channelId}&starttime=${startTime}&endtime=${endTime}` | ||
var a = document.createElement("a"); | ||
a.download = filename + ".flv"; | ||
a.href = url; | ||
var bodynode = document.querySelector('body') | ||
bodynode.append(a); // 修复firefox中无法触发click | ||
a.click(); | ||
a.remove(); | ||
} | ||
/** | ||
* 实时回放 | ||
@@ -169,0 +186,0 @@ */ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2687140
5674
192