Commit 0a75e7de by Tianqing Liu

feat: 抽离云台控制方法

1 parent 980e1c6c
...@@ -431,10 +431,7 @@ ...@@ -431,10 +431,7 @@
useWebGPU: true useWebGPU: true
}); });
g_jplayerHandle.on('ptz', (arrow) => { function handlePtzController(arrow) {
console.log('player on ptz:', arrow);
var speed = 255; var speed = 255;
var data = 0; var data = 0;
if (arrow == 'up') { if (arrow == 'up') {
...@@ -488,6 +485,11 @@ ...@@ -488,6 +485,11 @@
} }
jplayer_ptzControl('' + g_lastPtzCmd, '' + data, '' + speed); jplayer_ptzControl('' + g_lastPtzCmd, '' + data, '' + speed);
}
g_jplayerHandle.on('ptz', (arrow) => {
console.log('player on ptz:', arrow);
handlePtzController(arrow);
}) })
...@@ -892,8 +894,13 @@ ...@@ -892,8 +894,13 @@
} }
/**
* cmd 操作类型,上下左右、放大、缩小等
* para 1 表示停止,0表示移动
* speed 移动速度,默认为 255
*/
function jplayer_ptzControl(cmd, para, speed) { function jplayer_ptzControl(cmd, para, speed) {
// console.log('jplayer_ptzControl', cmd, para, speed);
var xhr = $.ajax({ var xhr = $.ajax({
url: "/nvsthird/ptzcontrol", url: "/nvsthird/ptzcontrol",
type: "post", type: "post",
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!