| var layer; | 
| $(function () { | 
|     layui.use(['layer'], function () { | 
|         layer = layui.layer; | 
|     }); | 
|     if(cameraData.playAddr){ | 
|         var html = ''; | 
|         html += '<object type="application/x-vlc-plugin" id="video-1"' + | 
|             'events="true" width="100%" height="100%"' + | 
|             'pluginspage="http://www.videolan.org"' + | 
|             'th:codebase="@{../../static/plugins/vlc/npapi-vlc-2.2.2.tar.xz}">' + | 
|             '<param name="mrl" value="' + cameraData.playAddr + '"/>'+ | 
|             '<param name="volume" value="50"/>' + | 
|             '<param name="autoplay" value="true"/>' + | 
|             '<param name="loop" value="false"/>' + | 
|             '<param name="fullscreen" value="true"/>' + | 
|             '<param name="toolbar" value="false"/>' + | 
|             '</object>'; | 
|         $("#video").html(html); | 
|     } | 
| }); | 
|   | 
| /** | 
|  * 云台控制 -转向控制 | 
|  * @param tag 执行命令 1=上,2=下,3=左,4=右,5=左上,6=左下,7=右上,8=右下,0=停止,9=变倍小,10 = 变倍加 | 
|  * | 
|  */ | 
| function mouseDownPTZControl(tag) { | 
|     // var data = { | 
|     //     cameraId:cameraData.id, | 
|     //     command: tag | 
|     // }; | 
|     var data = { | 
|         cameraId:cameraData.id, | 
|         ip:cameraData.ipIn, | 
|         playType:cameraData.playType, | 
|         portV:cameraData.portInV, | 
|         loginId:cameraData.loginId, | 
|         pwd:cameraData.pwd, | 
|         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 (0 != result.code) { | 
|                 console.log(result.msg); | 
|             } else { | 
|                 // layer.msg("执行成功……", | 
|                 //     {time: 3000, shift: 5, offset: "rb"}, | 
|                 //     function () { | 
|                 //     }); | 
|             } | 
|         }, | 
|         error: function (result) { | 
|             console.log(result.msg); | 
|         } | 
|     }); | 
| } | 
|   | 
| /** | 
|  * 云台控制 -转向停止 | 
|  * @param tag | 
|  */ | 
| function mouseUpPTZControl() { | 
|     // var data = { | 
|     //     cameraId:cameraData.id, | 
|     //     command: "0" | 
|     // }; | 
|     var data = { | 
|         cameraId:cameraData.id, | 
|         ip:cameraData.ipIn, | 
|         playType:cameraData.playType, | 
|         portV:cameraData.portInV, | 
|         loginId:cameraData.loginId, | 
|         pwd:cameraData.pwd, | 
|         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 (0 != result.code) { | 
|                 console.log(result.msg); | 
|             } else { | 
|                 // layer.msg("执行成功……", | 
|                 //     {time: 3000, shift: 5, offset: "rb"}, | 
|                 //     function () { | 
|                 //     }); | 
|             } | 
|         }, | 
|         error: function (result) { | 
|             console.log(result.msg); | 
|         } | 
|     }); | 
| } | 
|   | 
| /** | 
|  * 云台控制 -预置位置调用 | 
|  */ | 
| function clickGoPreset() { | 
|     // var data = { | 
|     //     cameraId:cameraData.id, | 
|     //     command: "2", | 
|     //     preset: 1 | 
|     // }; | 
|     var data = { | 
|         cameraId:cameraData.id, | 
|         ip:cameraData.ipIn, | 
|         playType:cameraData.playType, | 
|         portV:cameraData.portInV, | 
|         loginId:cameraData.loginId, | 
|         pwd:cameraData.pwd, | 
|         command: "2", | 
|         preset: 1 | 
|     }; | 
|     $.ajax({ | 
|         type: 'POST', | 
|         url: "../../basic/security/ptz-preset", | 
|         dataType: 'JSON', | 
|         contentType: "application/json;charset=UTF-8", | 
|         data: JSON.stringify(data), | 
|         success: function (result) { | 
|             if (0 != result.code) { | 
|                 console.log(result.msg); | 
|             } else { | 
|                 // layer.msg("执行成功……", | 
|                 //     {time: 3000, shift: 5, offset: "rb"}, | 
|                 //     function () { | 
|                 //     }); | 
|             } | 
|         }, | 
|         error: function (result) { | 
|             console.log(result.msg); | 
|         } | 
|     }); | 
| } |