123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167 |
- <!doctype html>
- <html>
- <head>
- <title></title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <meta http-equiv="Pragma" content="no-cache" />
- <meta http-equiv="Cache-Control" content="no-cache, must-revalidate" />
- <meta http-equiv="Expires" content="0" />
- </head>
- <style>
- .plugin {
- width: 600px;
- height: 400px;
- }
- </style>
- <body>
- <div>
- <div id="divPlugin" class="plugin"></div>
- </div>
- </body>
- <script src="../jquery-1.7.1.min.js"></script>
- <!-- <script>
- function openBypass(original_function) {
- return function(method, url, async) {
- if(url.indexOf('/ISAPI')>-1||url.indexOf('SDK/')>-1){
- if(url.indexOf(location.host)>-1){
- url=url.replace(location.host,getCookie("webVideoCtrlProxy")||"http://192.168.3.250:80")
- console.log({url})
- this.requestURL = url;
- }
- }
- return original_function.apply(this, arguments);
- };
- }
- function getCookie(cname)
- {
- var name = cname + "=";
- var ca = document.cookie.split(';');
- for(var i=0; i<ca.length; i++)
- {
- var c = ca[i].trim();
- if (c.indexOf(name)==0) return c.substring(name.length,c.length);
- }
- return "";
- }
- function sendBypass(original_function) {
- return function(data) {
- // 保存请求相关参数
- this.requestData = data;
- return original_function.apply(this, arguments);
- };
- }
- XMLHttpRequest.prototype.open = openBypass(XMLHttpRequest.prototype.open);
- </script> -->
- <script src="../codebase/encryption/AES.js"></script>
- <script src="../codebase/encryption/cryptico.min.js"></script>
- <!-- <script src="../codebase/encryption/encryption.js"></script> -->
- <script src="../codebase/encryption/crypto-3.1.2.min.js"></script>
- <script src="../codebase/webVideoCtrl.js"></script>
- <script>
- $(function () {
- // 检查插件是否已经安装过
- var iRet = WebVideoCtrl.I_CheckPluginInstall();
- if (-1 == iRet) {
- alert("您还未安装过插件,双击开发包目录里的WebComponentsKit.exe安装!");
- return;
- }
- var oPlugin = {
- iWidth: 600, // plugin width
- iHeight: 400 // plugin height
- };
- var oLiveView = {
- iProtocol: 1, // protocol 1:http, 2:https
- szIP: "192.168.3.250", // protocol ip
- szPort: "80", // protocol port
- szUsername: "admin", // device username
- szPassword: "qzz878616", // device password
- iStreamType: 1, // stream 1:main stream 2:sub-stream 3:third stream 4:transcode stream
- iChannelID: 1, // channel no
- bZeroChannel: false // zero channel
- };
- // 初始化插件参数及插入插件
- WebVideoCtrl.I_InitPlugin(oPlugin.iWidth, oPlugin.iHeight, {
- bWndFull: true,//是否支持单窗口双击全屏,默认支持 true:支持 false:不支持
- iWndowType: 1,
- cbInitPluginComplete: function () {
- WebVideoCtrl.I_InsertOBJECTPlugin("divPlugin");
- // 检查插件是否最新
- if (-1 == WebVideoCtrl.I_CheckPluginVersion()) {
- alert("检测到新的插件版本,双击开发包目录里的WebComponentsKit.exe升级!");
- return;
- }
- // 登录设备
- WebVideoCtrl.I_Login(oLiveView.szIP, oLiveView.iProtocol, oLiveView.szPort, oLiveView.szUsername, oLiveView.szPassword, {
- success: function (xmlDoc) {
- // 开始预览
- var szDeviceIdentify = oLiveView.szIP + "_" + oLiveView.szPort;
- setTimeout(function () {
- WebVideoCtrl.I_StartRealPlay(szDeviceIdentify, {
- iStreamType: oLiveView.iStreamType,
- iChannelID: oLiveView.iChannelID,
- bZeroChannel: oLiveView.bZeroChannel
- });
- }, 1000);
- }
- });
- }
- });
- // window.addEventListener("message", (e) => {
- // var oLiveView = {
- // iProtocol: 1, // protocol 1:http, 2:https
- // // szIP: "192.168.3.250", // protocol ip
- // // szPort: "80", // protocol port
- // // szUsername: "admin", // device username
- // // szPassword: "qzz878616", // device password
- // iStreamType: 1, // stream 1:main stream 2:sub-stream 3:third stream 4:transcode stream
- // iChannelID: 1, // channel no
- // bZeroChannel: false // zero channel
- // };
- // if(e.data.oLiveView){
- // oLiveView={...oLiveView,...e.data.oLiveView}
- // }
- // // 初始化插件参数及插入插件
- // WebVideoCtrl.I_InitPlugin(oPlugin.iWidth, oPlugin.iHeight, {
- // bWndFull: true,//是否支持单窗口双击全屏,默认支持 true:支持 false:不支持
- // iWndowType: 1,
- // cbInitPluginComplete: function () {
- // WebVideoCtrl.I_InsertOBJECTPlugin("divPlugin");
- // // 检查插件是否最新
- // if (-1 == WebVideoCtrl.I_CheckPluginVersion()) {
- // alert("检测到新的插件版本,双击开发包目录里的WebComponentsKit.exe升级!");
- // return;
- // }
- // // 登录设备
- // WebVideoCtrl.I_Login(oLiveView.szIP, oLiveView.iProtocol, oLiveView.szPort, oLiveView.szUsername, oLiveView.szPassword, {
- // success: function (xmlDoc) {
- // // 开始预览
- // var szDeviceIdentify = oLiveView.szIP + "_" + oLiveView.szPort;
- // setTimeout(function () {
- // WebVideoCtrl.I_StartRealPlay(szDeviceIdentify, {
- // iStreamType: oLiveView.iStreamType,
- // iChannelID: oLiveView.iChannelID,
- // bZeroChannel: oLiveView.bZeroChannel
- // });
- // }, 1000);
- // }
- // });
- // }
- // });
- // })
- // 关闭浏览器
- $(window).unload(function () {
- WebVideoCtrl.I_Stop();
- });
- });
- </script>
- </html>
|