Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9d51b17

Browse files
committed
[CHG]新增录像使用示例
1 parent ea78ad6 commit 9d51b17

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

demo/demo-monitor.html

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ <h2>预览,回放功能示例:</h2>
5252
<button id="getOSDTime">获取OSD时间</button>
5353
<button id="openSound">打开声音(默认已经开启)</button>
5454
<button id="capturePicture">视频截图</button>
55+
<button id="startSave">开始录像</button>
56+
<button id="stopSave">停止录像</button>
57+
<span>录制功能不支持加密视频,且录制的文件需要<a href="https://service.ys7.com/downloadInfoSite/admin" target="_blank">下载海康播放器播放</a></span>
5558

5659
</div>
5760
<div id="playWind" style="width: 600px; height: 400px;">
@@ -115,7 +118,13 @@ <h2>预览,回放功能示例:</h2>
115118
decoder.openSound();
116119
})
117120
$("#capturePicture").click(function () {
118-
decoder.capturePicture(0,'picName');
121+
decoder.capturePicture(0,'default');
122+
})
123+
$("#startSave").click(function () {
124+
decoder.startSave(0, (new Date().getTime() + 'video'));
125+
})
126+
$("#stopSave").click(function () {
127+
decoder.stopSave(0);
119128
})
120129
$("#play").click(function () {
121130
decoder.play();

ezuikit.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1163,6 +1163,7 @@
11631163
// 开始录像
11641164
EZUIPlayer.prototype.startSave = function (iWind, fileName) {
11651165
if (!!this.jSPlugin) {
1166+
this.log("开始录制录像");
11661167
this.jSPlugin.JS_StartSave(iWind, fileName)
11671168
} else {
11681169
throw new Error("Method not support");
@@ -1171,7 +1172,8 @@
11711172
// 结束录像
11721173
EZUIPlayer.prototype.stopSave = function (iWind) {
11731174
if (!!this.jSPlugin) {
1174-
this.jSPlugin.JS_StopSave(iWind)
1175+
this.jSPlugin.JS_StopSave(iWind);
1176+
this.log("结束录制录像");
11751177
} else {
11761178
throw new Error("Method not support");
11771179
}

0 commit comments

Comments
 (0)