| var layer; | 
| $(function () { | 
|     layui.use(['layer'], function () { | 
|         layer = layui.layer; | 
|     }); | 
|   | 
|     // 播放器回调函数 | 
|     callbackfun = function (e) { | 
|         console.log(e); | 
|     }; | 
|   | 
|     // 实例播放器 | 
|     var player = new WasmPlayer(null, 'newplay', callbackfun, { | 
|         Height: true, openAudio: false, BigPlay: false, HideKbs: true | 
|     }); | 
|   | 
|     player.play(cameraData.mediaAddr, 1); | 
| }); | 
|   | 
|   | 
| /** | 
|  * 云台控制 -转向控制 | 
|  * @param tag 执行命令 1=上,2=下,3=左,4=右,5=左上,6=左下,7=右上,8=右下,0=停止,9=变倍小,10 = 变倍加 | 
|  * | 
|  */ | 
| function mouseDownPTZControl(tag) { | 
|      | 
| //    console.log(cameraData); | 
|   | 
|     if("01" == cameraData.type){ | 
|         layer.msg("枪机摄像头不支持云台控制!"); | 
|         return; | 
|     } | 
|      | 
|     layer.msg("开始调用云平台……", | 
|         {time: 3000, shift: 5, offset: "rb"}, | 
|         function () { | 
|         }); | 
|   | 
|     var data = { | 
|         sn: cameraData.sn, | 
|         ip: cameraData.ipIn, | 
|         command: tag | 
|     }; | 
|     $.ajax({ | 
|         type: 'POST', | 
|         url: "../../basic/security/ptz-media", | 
|         dataType: 'JSON', | 
|         contentType: "application/json;charset=UTF-8", | 
|         data: JSON.stringify(data), | 
|         success: function (result) { | 
|             if ("ERROR" == result.code) { | 
|                 layer.alert(result.msg); | 
|             } else { | 
|                 layer.msg("执行成功……", | 
|                     {time: 3000, shift: 5, offset: "rb"}, | 
|                     function () { | 
|                     }); | 
|             } | 
|         }, | 
|         error: function (result) { | 
|             layer.alert(result.msg); | 
|         } | 
|     }); | 
| } | 
|   | 
| /** | 
|  * 云台控制 -转向停止 | 
|  * @param tag | 
|  */ | 
| function mouseUpPTZControl() { | 
|     if("01" == cameraData.type){ | 
|         return; | 
|     } | 
|   | 
|     var data = { | 
|         sn: cameraData.sn, | 
|         ip: cameraData.ipIn, | 
|         command: "0" | 
|     }; | 
|     $.ajax({ | 
|         type: 'POST', | 
|         url: "../../basic/security/ptz-media", | 
|         dataType: 'JSON', | 
|         contentType: "application/json;charset=UTF-8", | 
|         data: JSON.stringify(data), | 
|         success: function (result) { | 
|             if ("ERROR" == result.code) { | 
|                 layer.alert(result.msg); | 
|             } | 
|         }, | 
|         error: function (result) { | 
|             layer.alert(result.msg); | 
|         } | 
|     }); | 
| } | 
|   | 
| /** | 
|  * 云台控制 -预置位置调用 | 
|  */ | 
| function clickGoPreset() { | 
|     layer.msg("当前流媒体接口暂不支持预置位置控制!"); | 
| } | 
|   | 
| /** | 
|  * PTZZoomout 变倍 + | 
|  * @constructor | 
|  */ | 
| function PTZZoomout() { | 
|     if("01" == cameraData.type){ | 
|         layer.msg("枪机摄像头不支持云台控制!"); | 
|         return; | 
|     } | 
|   | 
|     layer.msg("开始调用云平台……", | 
|         {time: 3000, shift: 5, offset: "rb"}, | 
|         function () { | 
|         }); | 
|   | 
|     var data = { | 
|         sn: cameraData.sn, | 
|         ip: cameraData.ipIn, | 
|         command: "10" | 
|     }; | 
|     $.ajax({ | 
|         type: 'POST', | 
|         url: "../../basic/security/ptz-media", | 
|         dataType: 'JSON', | 
|         contentType: "application/json;charset=UTF-8", | 
|         data: JSON.stringify(data), | 
|         success: function (result) { | 
|             if ("ERROR" == result.code) { | 
|                 layer.alert(result.msg); | 
|             } else { | 
|                 layer.msg("执行成功……", | 
|                     {time: 3000, shift: 5, offset: "rb"}, | 
|                     function () { | 
|                     }); | 
|             } | 
|         }, | 
|         error: function (result) { | 
|             layer.alert(result.msg); | 
|         } | 
|     }); | 
| } | 
|   | 
| /** | 
|  * PTZZoomout 变倍 - | 
|  * @constructor | 
|  */ | 
| function PTZZoomIn() { | 
|     if("01" == cameraData.type){ | 
|         layer.msg("枪机摄像头不支持云台控制!"); | 
|         return; | 
|     } | 
|   | 
|     layer.msg("开始调用云平台……", | 
|         {time: 3000, shift: 5, offset: "rb"}, | 
|         function () { | 
|         }); | 
|   | 
|     var data = { | 
|         sn: cameraData.sn, | 
|         ip: cameraData.ipIn, | 
|         command: "9" | 
|     }; | 
|     $.ajax({ | 
|         type: 'POST', | 
|         url: "../../basic/security/ptz-media", | 
|         dataType: 'JSON', | 
|         contentType: "application/json;charset=UTF-8", | 
|         data: JSON.stringify(data), | 
|         success: function (result) { | 
|             if ("ERROR" == result.code) { | 
|                 layer.alert(result.msg); | 
|             } else { | 
|                 layer.msg("执行成功……", | 
|                     {time: 3000, shift: 5, offset: "rb"}, | 
|                     function () { | 
|                     }); | 
|             } | 
|         }, | 
|         error: function (result) { | 
|             layer.alert(result.msg); | 
|         } | 
|     }); | 
| } | 
|   | 
| /** | 
|  * PTZZoomout 变倍停止 | 
|  * @constructor | 
|  */ | 
| function PTZZoomStop() { | 
| } |