Your Name 3 lat temu
rodzic
commit
4b14d6e501

+ 151 - 126
index.html

@@ -62,99 +62,124 @@
             var dpr = 0;
             var scale = 0;
             var tid;
-            var flexible = lib.flexible || (lib.flexible = {});
-
-            if (metaEl) {
-                console.warn('将根据已有的meta标签来设置缩放比例');
-                var match = metaEl
-                    .getAttribute('content')
-                    .match(/initial\-scale=([\d\.]+)/);
-                if (match) {
-                    scale = parseFloat(match[1]);
-                    dpr = parseInt(1 / scale);
-                }
-            } else if (flexibleEl) {
-                var content = flexibleEl.getAttribute('content');
-                if (content) {
-                    var initialDpr = content.match(/initial\-dpr=([\d\.]+)/);
-                    var maximumDpr = content.match(/maximum\-dpr=([\d\.]+)/);
-                    if (initialDpr) {
-                        dpr = parseFloat(initialDpr[1]);
-                        scale = parseFloat((1 / dpr).toFixed(2));
-                    }
-                    if (maximumDpr) {
-                        dpr = parseFloat(maximumDpr[1]);
-                        scale = parseFloat((1 / dpr).toFixed(2));
-                    }
-                }
-            }
+            // var flexible = lib.flexible || (lib.flexible = {});
+
+            // if (metaEl) {
+            //     console.warn('将根据已有的meta标签来设置缩放比例');
+            //     var match = metaEl
+            //         .getAttribute('content')
+            //         .match(/initial\-scale=([\d\.]+)/);
+            //     if (match) {
+            //         scale = parseFloat(match[1]);
+            //         dpr = parseInt(1 / scale);
+            //     }
+            // } else if (flexibleEl) {
+            //     var content = flexibleEl.getAttribute('content');
+            //     if (content) {
+            //         var initialDpr = content.match(/initial\-dpr=([\d\.]+)/);
+            //         var maximumDpr = content.match(/maximum\-dpr=([\d\.]+)/);
+            //         if (initialDpr) {
+            //             dpr = parseFloat(initialDpr[1]);
+            //             scale = parseFloat((1 / dpr).toFixed(2));
+            //         }
+            //         if (maximumDpr) {
+            //             dpr = parseFloat(maximumDpr[1]);
+            //             scale = parseFloat((1 / dpr).toFixed(2));
+            //         }
+            //     }
+            // }
 
-            if (!dpr && !scale) {
-                var isAndroid = win.navigator.appVersion.match(/android/gi);
-                var isIPhone = win.navigator.appVersion.match(/iphone/gi);
-                var devicePixelRatio = win.devicePixelRatio;
-                if (isIPhone) {
-                    // iOS下,对于2和3的屏,用2倍的方案,其余的用1倍方案
-                    if (devicePixelRatio >= 3 && (!dpr || dpr >= 3)) {
-                        dpr = 3;
-                    } else if (devicePixelRatio >= 2 && (!dpr || dpr >= 2)) {
-                        dpr = 2;
-                    } else {
-                        dpr = 1;
-                    }
-                } else {
-                    // 其他设备下,仍旧使用1倍的方案
-                    dpr = 1;
-                }
-                scale = 1 / dpr;
-            }
+            // if (!dpr && !scale) {
+            //     var isAndroid = win.navigator.appVersion.match(/android/gi);
+            //     var isIPhone = win.navigator.appVersion.match(/iphone/gi);
+            //     var devicePixelRatio = win.devicePixelRatio;
+            //     if (isIPhone) {
+            //         // iOS下,对于2和3的屏,用2倍的方案,其余的用1倍方案
+            //         if (devicePixelRatio >= 3 && (!dpr || dpr >= 3)) {
+            //             dpr = 3;
+            //         } else if (devicePixelRatio >= 2 && (!dpr || dpr >= 2)) {
+            //             dpr = 2;
+            //         } else {
+            //             dpr = 1;
+            //         }
+            //     } else {
+            //         // 其他设备下,仍旧使用1倍的方案
+            //         dpr = 1;
+            //     }
+            //     scale = 1 / dpr;
+            // }
 
-            docEl.setAttribute('data-dpr', dpr);
-            if (!metaEl) {
-                metaEl = doc.createElement('meta');
-                metaEl.setAttribute('name', 'viewport');
-                metaEl.setAttribute(
-                    'content',
-                    'initial-scale=' +
-                    scale +
-                    ', maximum-scale=' +
-                    scale +
-                    ', minimum-scale=' +
-                    scale +
-                    ', user-scalable=no',
-                );
-                if (docEl.firstElementChild) {
-                    docEl.firstElementChild.appendChild(metaEl);
-                } else {
-                    var wrap = doc.createElement('div');
-                    wrap.appendChild(metaEl);
-                    doc.write(wrap.innerHTML);
-                }
-            }
-            var index = 0;
+            // docEl.setAttribute('data-dpr', dpr);
+            // if (!metaEl) {
+            //     metaEl = doc.createElement('meta');
+            //     metaEl.setAttribute('name', 'viewport');
+            //     metaEl.setAttribute(
+            //         'content',
+            //         'initial-scale=' +
+            //         scale +
+            //         ', maximum-scale=' +
+            //         scale +
+            //         ', minimum-scale=' +
+            //         scale +
+            //         ', user-scalable=no',
+            //     );
+            //     if (docEl.firstElementChild) {
+            //         docEl.firstElementChild.appendChild(metaEl);
+            //     } else {
+            //         var wrap = doc.createElement('div');
+            //         wrap.appendChild(metaEl);
+            //         doc.write(wrap.innerHTML);
+            //     }
+            // }
+            // var index = 0;
+            function  detectZoom () {
+		      let ratio = 0,
+		        screen = window.screen,
+		        ua = navigator.userAgent.toLowerCase();
+		      if (window.devicePixelRatio !== undefined) {
+		        ratio = window.devicePixelRatio;
+		      } else if (~ua.indexOf('msie')) {
+		        if (screen.deviceXDPI && screen.logicalXDPI) {
+		          ratio = screen.deviceXDPI / screen.logicalXDPI;
+		        }
+		      } else if (window.outerWidth !== undefined && window.innerWidth !== undefined) {
+		        ratio = window.outerWidth / window.innerWidth;
+		      }
+		      if (ratio) {
+		        ratio = Math.round(ratio * 100);
+		      }
+		      return ratio;
+		  }
 
             function refreshRem() {
-                var docEl = doc.documentElement;
-                var width = docEl.getBoundingClientRect().width;
-                if (width / dpr > 5760) {
-                    width = 5760 * dpr;
-                }
-                var rem = width / 10;
-                docEl.style.fontSize = rem + 'px';
-                flexible.rem = win.rem = rem;
-                var isMac = (navigator.platform == "Mac68K") || (navigator.platform == "MacPPC") || (navigator.platform == "Macintosh") || (navigator.platform == "MacIntel");
-                var t = window.devicePixelRatio // 获取下载的缩放 125% -> 1.25    150% -> 1.5
-                console.log(t)
-                if (t != 1 && !isMac) { // 如果进行了缩放,也就是不是1
-                    setTimeout(() => {
-                        document.body.style.zoom = -0.005 * t + 0.76; // 就去修改页面的缩放比例,这个公式我自己算的,不准确,勉强。
-                        if (window.map != undefined) {
-                            map.resize();
-                        }
-                    }, 2 * 1000)
-                } else {
-                    document.body.style.zoom = 1;
+
+                const m = detectZoom();
+                console.log(m, 'MMMMMMMMMMMMMMM')
+                document.body.style.zoom = 100/Number(m);
+                if (window.map != undefined) {
+                    map.resize();
                 }
+                // var docEl = doc.documentElement;
+                // var width = docEl.getBoundingClientRect().width;
+                // if (width / dpr > 5760) {
+                //     width = 5760 * dpr;
+                // }
+                // var rem = width / 10;
+                // docEl.style.fontSize = rem + 'px';
+                // flexible.rem = win.rem = rem;
+                // var isMac = (navigator.platform == "Mac68K") || (navigator.platform == "MacPPC") || (navigator.platform == "Macintosh") || (navigator.platform == "MacIntel");
+                // var t = window.devicePixelRatio // 获取下载的缩放 125% -> 1.25    150% -> 1.5
+                // console.log(t)
+                // if (t != 1 && !isMac) { // 如果进行了缩放,也就是不是1
+                //     setTimeout(() => {
+                //         document.body.style.zoom = -0.005 * t + 0.76; // 就去修改页面的缩放比例,这个公式我自己算的,不准确,勉强。
+                //         if (window.map != undefined) {
+                //             map.resize();
+                //         }
+                //     }, 2 * 1000)
+                // } else {
+                //     document.body.style.zoom = 1;
+                // }
 
 
             }
@@ -174,47 +199,47 @@
                 },
                 false,
             );
-            win.addEventListener(
-                'pageshow',
-                function(e) {
-                    if (e.persisted) {
-                        clearTimeout(tid);
-                        tid = setTimeout(refreshRem, 300);
-                    }
-                },
-                false,
-            );
-
-            if (doc.readyState === 'complete') {
-                doc.body.style.fontSize = 12 * dpr + 'px';
-            } else {
-                doc.addEventListener(
-                    'DOMContentLoaded',
-                    function(e) {
-                        doc.body.style.fontSize = 12 * dpr + 'px';
-                    },
-                    false,
-                );
-            }
+            // win.addEventListener(
+            //     'pageshow',
+            //     function(e) {
+            //         if (e.persisted) {
+            //             clearTimeout(tid);
+            //             tid = setTimeout(refreshRem, 300);
+            //         }
+            //     },
+            //     false,
+            // );
+
+            // if (doc.readyState === 'complete') {
+            //     doc.body.style.fontSize = 12 * dpr + 'px';
+            // } else {
+            //     doc.addEventListener(
+            //         'DOMContentLoaded',
+            //         function(e) {
+            //             doc.body.style.fontSize = 12 * dpr + 'px';
+            //         },
+            //         false,
+            //     );
+            // }
 
             refreshRem();
 
-            flexible.dpr = win.dpr = dpr;
-            flexible.refreshRem = refreshRem;
-            flexible.rem2px = function(d) {
-                var val = parseFloat(d) * this.rem;
-                if (typeof d === 'string' && d.match(/rem$/)) {
-                    val += 'px';
-                }
-                return val;
-            };
-            flexible.px2rem = function(d) {
-                var val = parseFloat(d) / this.rem;
-                if (typeof d === 'string' && d.match(/px$/)) {
-                    val += 'rem';
-                }
-                return val;
-            };
+            // flexible.dpr = win.dpr = dpr;
+            // flexible.refreshRem = refreshRem;
+            // flexible.rem2px = function(d) {
+            //     var val = parseFloat(d) * this.rem;
+            //     if (typeof d === 'string' && d.match(/rem$/)) {
+            //         val += 'px';
+            //     }
+            //     return val;
+            // };
+            // flexible.px2rem = function(d) {
+            //     var val = parseFloat(d) / this.rem;
+            //     if (typeof d === 'string' && d.match(/px$/)) {
+            //         val += 'rem';
+            //     }
+            //     return val;
+            // };
         })(window, window['lib'] || (window['lib'] = {}));
     </script>
 </head>

+ 59 - 7
public/js/videoplay.js

@@ -23,13 +23,65 @@ window.onload = () => {
         package.login();
     }
 
+  
+    // const meeting1 = new Meeting();
+    // const channelid1 = 'lJmfmlS0A1DJAUR81P9T9O';
+    // meeting1.openClient(() => {
+      
+    //     meeting1.settargetId("relvideo2")
+    //     meeting1.playVideo({
+    //         type: "single",
+    //         deviceId: channelid1,
+    //         channelId: channelid1,
+    //     });
+   
+    //     const meeting2 = new Meeting();
+    //     meeting2.settargetId("relvideo1")
+    //     meeting2.playVideo({
+    //         type: "single",
+    //         deviceId: channelid1,
+    //         channelId: channelid1,
+    //     });
+    // });
+
+   
+    
+       
+        
 
-    const meeting = new Meeting();
-    // const channelid = getQueryVariable("channelId");
-    // console.log(channelid);
-    const channelid = 'lJmfmlS0A1DJAUR81P9T9O';
 
+    // const meeting = new Meeting();
     // meeting.openClient(() => {
+    //     window.meeting = meeting;
+    //     // debugger
+    //     // meeting.settargetId("");
+    // });
+    
+
+    // const meeting2 = new Meeting();
+    // const channelid2 = 'lJmfmlS0A1DJAUR81P9T9O';
+    
+
+    // meeting2.openClient(() => {
+    //     meeting2.settargetId("relvideo1")
+    //     meeting2.playVideo({
+    //         type: "single",
+    //         deviceId: channelid2,
+    //         channelId: channelid2,
+    //     });
+    // });
+
+    
+    
+    
+
+
+    // const meeting1 = new Meeting();
+    // // const channelid = getQueryVariable("channelId");
+    // // console.log(channelid);
+    // const channelid1 = 'lJmfmlS0A1DJAUR81P9T9O';
+
+    // meeting1.openClient(() => {
     //     //   $(".video-action").one("click", () => {
     //     //     meeting.closeClient();
     //     //     meeting.closeVideo();
@@ -39,10 +91,10 @@ window.onload = () => {
     //     //     });
     //     //     window.parent.postMessage("closeIframe", "*");
     //     //   });
-    //     meeting.playVideo({
+    //     meeting1.playVideo({
     //         type: "single",
-    //         deviceId: channelid,
-    //         channelId: channelid,
+    //         deviceId: channelid1,
+    //         channelId: channelid1,
     //     });
     // });
 

+ 32 - 16
public/meeting.js

@@ -62,22 +62,24 @@ var Meeting = function Meeting() {
     this.$Message = {
         warning: (data) => {
             console.log(data);
+            // alert(data)
 
         }
-    }
+    };
+    this.targetid = "vPlayArea"
 };
 
 Meeting.prototype = {
     initSocket(userCode, callback) {
         const self = this;
         //初始websocket实例,保存在window中方便调用。一个浏览器tab页面只能初始化一次。所有的控件窗口,通过该websocket实例去生成不同的窗口实例,不同的控件窗口通过自己的窗口实例去调用初始化、关闭、隐藏等
-        window.theSocket = this.theSocket = new InitWebSocketClass(
+         window.theSocket= this.theSocket = new InitWebSocketClass(
             userCode,
             localStorage.getItem("token"), {
                 //客户端登陆成功通知;
                 loginSuccess: (v) => {
                     console.log("loginSuccess-->", v);
-                    self.initWnd();
+                    // self.initWnd();
                 },
                 //客户端窗口被拉起通知
                 onCreateVideoSuccess: (v) => {
@@ -91,10 +93,10 @@ Meeting.prototype = {
                         data.method === "createVideoDialogReuslt" &&
                         data.params.result === 0
                     ) {
-                        if (data.params.handleName === "#vPlayArea") {
+                        if (data.params.handleName === "#"+this.targetid) {
                             //客户端窗口创建好后,界面显示窗口;
                             callback && callback()
-                            self.vPlayArea.resize();
+                            self[self.targetid].resize();
                             this.$Message.warning("视频窗口创建成功!");
                         }
                     }
@@ -102,15 +104,16 @@ Meeting.prototype = {
             }
         );
         //socket实例初始化websocket回调方法;
-        this.theSocket
+        window.theSocket
             .initWebSocket()
             .then((v) => {
                 if (v) {
                     this.$Message.warning("视频插件登陆完成!");
                 }
+                callback();
             })
             .catch((v) => {
-                this.$Message.warning("若要观看实时视频,请先安装视频插件");
+                this.$Message.warning("若要观看实时视频,请先安装视频插件大华应急指挥调度实战平台客户端打开失败, 请尝试刷新页面重试");
             });
 
     },
@@ -144,7 +147,7 @@ Meeting.prototype = {
         const typeObj = {
             rows: 1,
             cols: 1,
-            wndSpaceing: 10,
+            wndSpaceing: 0,
             embedVideoMode: true,
             playerCtrlBarEnable: false,
             displayMode: 1,
@@ -153,27 +156,26 @@ Meeting.prototype = {
             webControlExpend: true
         };
         //左边窗口实例
-        window.vPlayArea = this.vPlayArea = new VideoPlay(
-            "#vPlayArea",
+        window[this.targetid] = this[this.targetid] = new VideoPlay(
+            "#"+this.targetid,
             window.theSocket.websocket, //一个浏览器tab页面公用一个
             window.theSocket.socketCode, //一个浏览器tab页面公用一个
             typeObj
         );
         //左边窗口初始化
-        this.vPlayArea.init();
+        this[this.targetid].init();
     },
     //播放视频
     playVideo(item) {
-        console.log('++++++', 'playVideo');
 
-        if (!this.theSocket.websocket) {
+        if (!window.theSocket.websocket) {
             this.$Message.warning("请先打开视频插件");
             return;
         }
         if (item.type == "client") {
             this.slectOptionmini(item.userId).then((arr) => {
                 if (arr) {
-                    this.vPlayArea.openAppVideo(arr);
+                    this[this.targetid].openAppVideo(arr);
                 }
             });
         } else if (item.type == "single") {
@@ -205,8 +207,11 @@ Meeting.prototype = {
     // },
     //设备视频拉流
     pullFlow(chinnelId) {
+      
         if (chinnelId) {
-            window.vPlayArea && window.vPlayArea.realTimeVideo && window.vPlayArea.realTimeVideo([{
+            this[this.targetid].showBrower(true);
+            this[this.targetid].dragResize(0,0,0,0);
+            window[this.targetid] && window[this.targetid].realTimeVideo && window[this.targetid].realTimeVideo([{
                 "channelId": chinnelId
             }]);
         }
@@ -463,7 +468,9 @@ Meeting.prototype = {
     },
     closeVideo() {
         try {
-            this.theSocket.closeAllVideo && this.theSocket.closeAllVideo();
+            // this.theSocket.closeAllVideo && this.theSocket.closeAllVideo();
+            this[this.targetid].closeAllVideo();
+            this[this.targetid].showBrower(false);
         } catch (E) {}
     },
     /* 获取群聊fromName */
@@ -524,4 +531,13 @@ Meeting.prototype = {
         // let container = _this.$el.querySelector("#meetResBack textarea");
         // container.scrollTop = container.scrollHeight;
     },
+    settargetId(id){
+        let _this = this;
+        if(id!=""){
+            _this.targetid = id;
+        }
+       
+        _this.initWnd();
+
+    }
 };

+ 3 - 4
public/webClient/initWebSocket.js

@@ -51,7 +51,7 @@ class InitWebSocketClass {
             return;
         }
         if (this.websocket.readyState === 1) {
-            console.log(this.websocket.readyState)
+            // console.log(this.websocket.readyState)
             this.websocket.send(data);
         } else {
             setTimeout(() => {
@@ -61,7 +61,6 @@ class InitWebSocketClass {
     }
 
     initWebSocket() {
-        console.log(1111);
         // 初始化WebSocket
         return new Promise((resolve, reject) => {
             try {
@@ -82,7 +81,7 @@ class InitWebSocketClass {
                     // DISCONNECTED
                 };
                 this.websocket.onmessage = evt => {
-                    console.log(evt);
+                    // console.log(evt);
                     if (evt && evt.data) {
                         if (evt.data === "client is runing!") {
                             // 用隐藏方法,只断连接去拉视频后的返回
@@ -93,7 +92,7 @@ class InitWebSocketClass {
                             return;
                         }
                         const data = JSON.parse(evt.data);
-                        console.log(data);
+                        // console.log(data);
                         if (
                             data &&
                             data.params &&

+ 397 - 463
public/webClient/webClient_initWnd.js

@@ -1,6 +1,5 @@
 class VideoPlay {
-    constructor(spaceId, websocket, socketCode, vModeObj = {}, options) {
-        // spaceId,socketCode不能相同,vModeObj播放模式,是否轮播
+    constructor(spaceId, websocket, socketCode, vModeObj = {}, options) { // spaceId,socketCode不能相同,vModeObj播放模式,是否轮播
         this.handleName = spaceId;
         this.socketCode = socketCode;
         this.vModeObj = vModeObj;
@@ -21,14 +20,13 @@ class VideoPlay {
         this.posX = 0; // 实时存放视频区域距离浏览器左边的距离
         this.posY = 0; // 实时存放视频区域距离浏览器顶部的距离
         this.scale = false; // 是否开始伸缩网页
-        this.defaults = {
-            // 默认配置,可以通过option覆盖
+        this.defaults = { // 默认配置,可以通过option覆盖
             protocol: defaultConfig.protocol, // 协议
             letLoginIp: defaultConfig.loginIp, // 环境配置
             letPort: defaultConfig.port, // 端口配置
             letUserCode: localStorage.getItem("userId"), // 用户code
             wsUri: "ws://localhost:1234",
-            token: localStorage.getItem("DAHUA_token"), // token
+            token: localStorage.getItem("token"), // token
             getVersion: null, // option里面的获取版本信息的回调函数通知
             loginSuccess: null, // 登陆成功会调通知
             errorInfo: null, // 异常回调通知
@@ -52,111 +50,107 @@ class VideoPlay {
 
     // 初始化
     init() {
-            this.calcTools();
-            this.initClientPanel();
-            this.winMaxMinOpt();
-            window.addEventListener("resize", () => {
-                this.resize();
-            });
-            window.onunload = () => {
-                this.closeClient();
-            };
-        }
-        // webSocket交互
+        this.calcTools();
+        this.initClientPanel();
+        this.winMaxMinOpt();
+        window.addEventListener("resize", () => {
+            this.resize();
+        });
+        window.onunload = () => {
+            this.closeClient();
+        };
+    }
+    // webSocket交互
     webSocketSend(data) {
-            if (this.websocket == null) {
-                return;
-            }
-            if (this.websocket.readyState === 1) {
-                this.websocket.send(data);
-            } else {
-                setTimeout(() => {
-                    this.webSocketSend(data);
-                }, 1000);
-            }
+        if (this.websocket == null) {
+            return;
         }
-        // 检测浏览器的缩放状态实现代码
+        if (this.websocket.readyState === 1) {
+            this.websocket.send(data);
+        } else {
+            setTimeout(() => {
+                this.webSocketSend(data);
+            }, 1000);
+        }
+    }
+    // 检测浏览器的缩放状态实现代码
     detectZoom() {
-            var ratio = 0;
-            var screen = window.screen;
-            var ua = navigator.userAgent.toLowerCase();
+        var ratio = 0;
+        var screen = window.screen;
+        var ua = navigator.userAgent.toLowerCase();
 
-            if (window.devicePixelRatio !== undefined) {
-                ratio = window.devicePixelRatio;
-            } else if (~ua.indexOf("msie")) {
-                if (screen.deviceXDPI && screen.logicalXDPI) {
-                    ratio = screen.deviceXDPI / screen.logicalXDPI;
-                }
-            } else if (
-                window.outerWidth !== undefined &&
-                window.innerWidth !== undefined
-            ) {
-                ratio = window.outerWidth / window.innerWidth;
+        if (window.devicePixelRatio !== undefined) {
+            ratio = window.devicePixelRatio;
+        } else if (~ua.indexOf("msie")) {
+            if (screen.deviceXDPI && screen.logicalXDPI) {
+                ratio = screen.deviceXDPI / screen.logicalXDPI;
             }
+        } else if (window.outerWidth !== undefined && window.innerWidth !== undefined) {
+            ratio = window.outerWidth / window.innerWidth;
+        }
 
-            if (ratio) {
-                ratio = Math.round(ratio * 100);
-            }
-            return ratio;
+        if (ratio) {
+            ratio = Math.round(ratio * 100);
         }
-        // 实时传递给客户端的位置大小
+        return ratio;
+    }
+    // 实时传递给客户端的位置大小
     dragResize(width, height, posX, posY) {
-            // 实时存储目前视频的大小位置;
-            this.width = width;
-            this.height = height;
-            this.posX = posX;
-            this.posY = posY;
-            const params = {
-                loginIp: this.settings.letLoginIp,
-                method: "adjustSizePosition",
-                params: {
-                    width: width,
-                    height: height,
-                    posX: this.posX,
-                    posY: this.posY,
-                    handleName: this.handleName
-                },
-                userCode: this.settings.letUserCode,
-                socketCode: this.socketCode
-            };
-            this.webSocketSend(JSON.stringify(params));
-        }
-        // 设置菜单遮挡问题
+        var c = this.space.getBoundingClientRect();
+        posX = Math.round(   c.left* window.outerWidth/window.innerWidth  );
+        posY = Math.round(   c.top* window.outerWidth/window.innerWidth  + window.outerHeight - window.innerHeight);
+        width = Math.round(   c.width * window.outerWidth/window.innerWidth );
+        height = Math.round(c.height* window.outerWidth/window.innerWidth );
+
+        // console.log(c)
+  
+
+        // 实时存储目前视频的大小位置;
+        this.width = width;
+        this.height = height;
+        this.posX = posX;
+        this.posY = posY;
+        const params = {
+            "loginIp": this.settings.letLoginIp,
+            "method": "adjustSizePosition",
+            "params": {
+                "width": width,
+                "height": height,
+                "posX": this.posX,
+                "posY": this.posY,
+                "handleName": this.handleName
+            },
+            "userCode": this.settings.letUserCode,
+            "socketCode": this.socketCode
+        };
+        console.log(JSON.stringify(params))
+        this.webSocketSend(JSON.stringify(params));
+    }
+    // 设置菜单遮挡问题
     setCoinRegion(flag, dorpDownIdArr) {
-            const isEmbed = flag;
-            let menu;
-            let menuLeftX = 0;
-            let menuLeftY = 0;
-            const arr = [];
-            this.zoom = this.detectZoom() / 100; // 910add
-            if (flag === true) {
-                // const obj = {};
-                dorpDownIdArr.map((item, index) => {
-                    arr.push({});
-                    // obj[index] = document.querySelector(v);
-                    menu = document.querySelector(item);
-                    // 菜单宽高
-                    arr[index]["width"] = Math.round(menu.clientWidth * this.zoom);
-                    arr[index]["height"] = Math.round(
-                        menu.clientHeight * this.zoom
-                    );
-                    // 菜单左上角相对浏览器左上角的坐标
-                    // 菜单左上角相对浏览器左上角的坐标
-                    menuLeftX = Math.round(
-                        menu.getBoundingClientRect().left * this.zoom - 2
-                    );
-                    menuLeftY = Math.round(
-                        menu.getBoundingClientRect().top * this.zoom +
-                        this._toolHeight
-                    );
-                    arr[index]["posX"] = Math.round(
-                        menuLeftX + this.iframetoWinX * this.zoom
-                    );
-                    arr[index]["posY"] = Math.round(
-                        menuLeftY + this.iframetoWinY * this.zoom
-                    );
-                });
-                /* Array.from(arguments).splice(1, Array.from(arguments).length - 1).forEach((v, index) => {
+        const isEmbed = flag;
+        let menu;
+        let menuLeftX = 0;
+        let menuLeftY = 0;
+        const arr = [];
+        this.zoom = this.detectZoom() / 100; // 910add
+        if (flag === true) {
+            // const obj = {};
+            dorpDownIdArr.map((item, index) => {
+                arr.push({});
+                // obj[index] = document.querySelector(v);
+                menu = document.querySelector(item);
+                // 菜单宽高
+                arr[index]["width"] = Math.round(menu.clientWidth * this.zoom);
+                arr[index]["height"] = Math.round(menu.clientHeight * this.zoom);
+                // 菜单左上角相对浏览器左上角的坐标
+                // 菜单左上角相对浏览器左上角的坐标
+                menuLeftX = Math.round(menu.getBoundingClientRect().left * this.zoom - 2);
+                menuLeftY = Math.round(menu.getBoundingClientRect().top * this.zoom + this._toolHeight);
+                arr[index]["posX"] = Math.round(menuLeftX + this.iframetoWinX * this.zoom);
+                arr[index]["posY"] = Math.round(menuLeftY + this.iframetoWinY * this.zoom);
+            });
+            /* Array.from(arguments).splice(1, Array.from(arguments).length - 1).forEach((v, index) => {
 				arr.push({});
 				obj[index] = document.querySelector(v);
 				menu = document.querySelector(dorpDownId);
@@ -176,251 +170,183 @@ class VideoPlay {
 					}
 				}
 			}) */
-            }
-            // console.log(arr);
-            const params = {
-                loginIp: this.settings.letLoginIp,
-                method: "setCoinRegion",
-                params: {
-                    bCoincide: isEmbed,
-                    region: arr,
-                    handleName: this.handleName
-                },
-                userCode: this.settings.letUserCode,
-                socketCode: this.socketCode
-            };
-            this.webSocketSend(JSON.stringify(params));
         }
-        // 计算顶部距离,网页伸缩不变,这个针对不同分辨率的电脑,如果不准,第三方自己修改,只提供如下几种适配电脑。
+        // console.log(arr);
+        const params = {
+            "loginIp": this.settings.letLoginIp,
+            "method": "setCoinRegion",
+            "params": {
+                "bCoincide": isEmbed,
+                "region": arr,
+                "handleName": this.handleName
+            },
+            "userCode": this.settings.letUserCode,
+            "socketCode": this.socketCode
+        };
+        this.webSocketSend(JSON.stringify(params));
+    }
+    // 计算顶部距离,网页伸缩不变,这个针对不同分辨率的电脑,如果不准,第三方自己修改,只提供如下几种适配电脑。
     calcTools() {
-            // const toolh = Math.round(window.outerHeight - (window.innerHeight) * this.detectZoom() / 100);
-            // this._toolHeight = toolh < 0 ? 80 : toolh;
-            // this.zoom = this.detectZoom() / 100;
-            this.zoom = this.detectZoom() / 100;
-            // console.log(this.zoom);
-            // if (this.zoom === 0.67) {
-            //     // 现场笔记本
-            //     this._toolHeight = 80;
-            // } else if (this.zoom === 1.5) {
-            //     this._toolHeight = 110;
-            // } else if (this.zoom === 3) {
-            //     this._toolHeight = 232;
-            // } else {
-            const toolh =
-                //(window.screen.height - window.screen.availHeight) * this.zoom; //
-                window.outerHeight - window.innerHeight;
-
+        // const toolh = Math.round(window.outerHeight - (window.innerHeight) * this.detectZoom() / 100);
+        // this._toolHeight = toolh < 0 ? 80 : toolh;
+        // this.zoom = this.detectZoom() / 100;
+        this.zoom = this.detectZoom() / 100;
+        if (this.zoom === 0.67) { // 现场笔记本
+            this._toolHeight = 80;
+        } else if (this.zoom === 1.5) {
+            this._toolHeight = 110;
+        } else if (this.zoom === 3) {
+            this._toolHeight = 232;
+        } else {
+            const toolh = Math.round(window.outerHeight - (window.innerHeight) * this.detectZoom() / 100);
             this._toolHeight = toolh < 0 ? 90 : toolh;
-            // }
         }
-        // 网页变操作化大小
+    }
+    // 网页变操作化大小
     resize() {
-            // console.log(33333);
-            console.log(this.status);
-            console.log(this.vModeObj.embedVideoMode);
-            // if (!this.status || !this.vModeObj.embedVideoMode) {
-            //     console.log('false');
-            //     return false;
-            // }
-            const calcDomWidth =
-                this.space.clientWidth || this.space.getBoundingClientRect().width;
-            const calcDomheight =
-                this.space.clientHeight ||
-                this.space.getBoundingClientRect().height;
-            const zoom = this.detectZoom() / 100;
-            const realClientWidth = Math.floor(calcDomWidth);
-            const realClientHeight = Math.floor(calcDomheight);
-            console.log("zoom---_toolHeight---", zoom, this._toolHeight);
-            // 防止初始化后设置隐藏hide后拖动浏览器再show显示在左上方问题
-            if (this.space.clientWidth === 0 && this.space.clientHeight === 0) {
-                return;
-            }
-            if (zoom === 1) {
-                // 默认伸缩状态
-                // posX:距离浏览器左顶点横轴距离;posY:距离浏览器左顶点纵轴距离
-                let posX = this.space.getBoundingClientRect().left;
-                let posY;
-                if (window.outerWidth === window.innerWidth) {
-                    // 普通浏览器最大化状态
-                    if (this.fullToolH == null) {
-                        // 为空时才计算,避免上下拖动改变浏览器大小事,视频窗口抖动
-                        this.fullToolL =
-                            (window.outerWidth - window.innerWidth) / 2;
-                        // _this.fullToolH = window.outerHeight - window.innerHeight - _this.fullToolL + 10;
-                        this.fullToolH = this._toolHeight;
-                    }
-                    posY = this.space.getBoundingClientRect().top + this.fullToolH;
-                } else if (window.outerWidth - window.innerWidth < 0) {
-                    // F11全屏窗口计算
-                    posX = this.space.getBoundingClientRect().left;
-                    posY = this.space.getBoundingClientRect().top;
-                } else {
-                    // 浏览器非最大化状态
-                    if (this.toolH == null) {
-                        this.toolL = (window.outerWidth - window.innerWidth) / 2;
-                        this.toolH =
-                            window.outerHeight - window.innerHeight - this.toolL;
-                    }
-                    posX = this.space.getBoundingClientRect().left;
-                    posY = this.space.getBoundingClientRect().top + this.toolH + 0;
+        if (!this.status || !this.vModeObj.embedVideoMode) {
+            return false;
+        }
+        const calcDomWidth = this.space.clientWidth || this.space.getBoundingClientRect().width;
+        const calcDomheight = this.space.clientHeight || this.space.getBoundingClientRect().height;
+        const zoom = this.detectZoom() / 100;
+        const realClientWidth = Math.round(calcDomWidth * zoom);
+        const realClientHeight = Math.round(calcDomheight * zoom);
+        console.log("zoom---_toolHeight---", zoom, this._toolHeight);
+        // 防止初始化后设置隐藏hide后拖动浏览器再show显示在左上方问题
+        if (this.space.clientWidth === 0 && this.space.clientHeight === 0) {
+            return;
+        }
+        if (zoom === 1) {
+            // 默认伸缩状态
+            // posX:距离浏览器左顶点横轴距离;posY:距离浏览器左顶点纵轴距离
+            let posX = this.space.getBoundingClientRect().left;
+            let posY;
+            if (window.outerWidth === window.innerWidth) {
+                // 普通浏览器最大化状态
+                if (this.fullToolH == null) {
+                    // 为空时才计算,避免上下拖动改变浏览器大小事,视频窗口抖动
+                    this.fullToolL = (window.outerWidth - window.innerWidth) / 2;
+                    // _this.fullToolH = window.outerHeight - window.innerHeight - _this.fullToolL + 10;
+                    this.fullToolH = this._toolHeight;
                 }
-                posX = Math.round(posX);
-                posY = Math.round(posY);
-                this.dragResize(realClientWidth, realClientHeight, posX, posY);
-                console.log(
-                    "dragResize1-->",
-                    realClientWidth,
-                    realClientHeight,
-                    posX,
-                    posY
-                );
+                posY = this.space.getBoundingClientRect().top + this.fullToolH;
+            } else if (window.outerWidth - window.innerWidth < 0) {
+                // F11全屏窗口计算
+                posX = this.space.getBoundingClientRect().left;
+                posY = this.space.getBoundingClientRect().top;
             } else {
-                if (
-                    window.outerHeight - window.innerHeight === 288 ||
-                    window.outerWidth - window.innerWidth < 0
-                ) {
-                    // 最大化
-                    const longW = Math.round(
-                        this.space.getBoundingClientRect().left
-                    );
-                    const longH = Math.round(
-                        this.space.getBoundingClientRect().top
-                    );
-                    this.dragResize(
-                        realClientWidth,
-                        realClientHeight,
-                        longW,
-                        longH
-                    );
-                    console.log(
-                        "最大化dragResize2-->",
-                        realClientWidth,
-                        realClientHeight,
-                        longW,
-                        longH
-                    );
-                } else {
-
-                    const longW = Math.round(
-                        this.space.getBoundingClientRect().left
-                    );
-                    const longH = Math.round(
-                        this.space.getBoundingClientRect().top +
-                        this._toolHeight
-                    );
-                    // debugger
-                    this.dragResize(
-                        realClientWidth,
-                        realClientHeight,
-                        longW,
-                        longH
-                    );
-                    console.log(
-                        "dragResize2-->",
-                        realClientWidth,
-                        realClientHeight,
-                        longW,
-                        longH
-                    );
+                // 浏览器非最大化状态
+                if (this.toolH == null) {
+                    this.toolL = (window.outerWidth - window.innerWidth) / 2;
+                    this.toolH = window.outerHeight - window.innerHeight - this.toolL;
                 }
+                posX = this.space.getBoundingClientRect().left;
+                posY = this.space.getBoundingClientRect().top + this.toolH + 0;
+            }
+            posX = Math.round(posX);
+            posY = Math.round(posY);
+            this.dragResize(realClientWidth, realClientHeight, posX, posY);
+            console.log("dragResize1-->", realClientWidth, realClientHeight, posX, posY);
+        } else {
+            if (window.outerHeight - window.innerHeight === 288 || window.outerWidth - window.innerWidth < 0) { // 最大化
+                const longW = Math.round(this.space.getBoundingClientRect().left * zoom);
+                const longH = Math.round(this.space.getBoundingClientRect().top * zoom);
+                this.dragResize(realClientWidth, realClientHeight, longW, longH);
+                console.log("最大化dragResize2-->", realClientWidth, realClientHeight, longW, longH);
+            } else {
+                const longW = Math.round(this.space.getBoundingClientRect().left * zoom);
+                const longH = Math.round(this.space.getBoundingClientRect().top * zoom + this._toolHeight);
+                this.dragResize(realClientWidth, realClientHeight, longW, longH);
+                console.log("dragResize2-->", realClientWidth, realClientHeight, longW, longH);
             }
         }
-        // 创建视频窗口
+    }
+    // 创建视频窗口
     createVideoDialog(obj) {
-            console.log(obj);
-            const {
-                rows = 2,
-                    cols = 2,
-                    wndSpaceing = 0,
-                    embedVideoMode = true,
-                    playerCtrlBarEnable = false,
-                    displayMode = 0,
-                    playMode = 0,
-                    playParams = {},
-                    webControlExpend = false
-            } = obj;
-            let playParamsObj = null;
-            playMode === 0 ? (playParamsObj = {}) : (playParamsObj = playParams);
-            const params = JSON.stringify({
-                loginIp: this.settings.letLoginIp,
-                userCode: this.settings.letUserCode,
-                socketCode: this.socketCode,
-                method: "CreateVideoDialog",
-                params: {
-                    handleName: this.handleName,
-                    rows: rows,
-                    cols: cols,
-                    wndSpaceing: wndSpaceing, // 视频播放窗口间隔,默认为0
-                    embedVideoMode: embedVideoMode, // 视频窗口是否为嵌入式。true:嵌入式(列表框云台和标题栏不展示),false:弹出式(展示列表框云台和标题栏)
-                    playerCtrlBarEnable: playerCtrlBarEnable, // 视频窗口上的鼠标云台是否使能。true:展示,false:不展示
-                    displayMode: displayMode, // 窗口显示模式,用于播放控制栏0:视频监控,显示播放控制栏;  1:轮播,隐藏播放控制栏
-                    playMode: playMode, // playMode:播放模式,0: 普通模式,1:轮播模式,默认为普通播放模式
-                    playParams: playParamsObj, // playMode=0,playParams为空;playMode=1,playParams格式如下:// 轮播时间间隔,单位秒,默认为5s
-                    webControlExpend: webControlExpend
-                }
-            });
-            console.log(params);
-            this.webSocketSend(params);
-        }
-        //初始化窗口
+        const {
+            rows = 2, cols = 2, wndSpaceing = 0, embedVideoMode = true, playerCtrlBarEnable = false, displayMode = 0, playMode = 0, playParams = {}, webControlExpend = false
+        } = obj;
+        let playParamsObj = null;
+        playMode === 0 ? playParamsObj = {} : playParamsObj = playParams;
+        const params = JSON.stringify({
+            "loginIp": this.settings.letLoginIp,
+            "userCode": this.settings.letUserCode,
+            "socketCode": this.socketCode,
+            "method": "CreateVideoDialog",
+            "params": {
+                "handleName": this.handleName,
+                "rows": rows,
+                "cols": cols,
+                "wndSpaceing": wndSpaceing, // 视频播放窗口间隔,默认为0
+                "embedVideoMode": embedVideoMode, // 视频窗口是否为嵌入式。true:嵌入式(列表框云台和标题栏不展示),false:弹出式(展示列表框云台和标题栏)
+                "playerCtrlBarEnable": playerCtrlBarEnable, // 视频窗口上的鼠标云台是否使能。true:展示,false:不展示
+                "displayMode": displayMode, // 窗口显示模式,用于播放控制栏0:视频监控,显示播放控制栏;  1:轮播,隐藏播放控制栏
+                "playMode": playMode, // playMode:播放模式,0: 普通模式,1:轮播模式,默认为普通播放模式
+                "playParams": playParamsObj,// playMode=0,playParams为空;playMode=1,playParams格式如下:// 轮播时间间隔,单位秒,默认为5s
+                "webControlExpend": webControlExpend
+            }
+        });
+        this.webSocketSend(params);
+    }
+    //初始化窗口
     initClientPanel() {
-            this.createVideoDialog(this.vModeObj);
-        }
-        // 实时预览视频
-    realTimeVideo(
-            arr = [{
-                channelId: ""
-            }]
-        ) {
-            const params = JSON.stringify({
-                loginIp: this.settings.letLoginIp,
-                method: "openVideo",
-                params: {
-                    array: arr, // [{"channelId": channelId}]
-                    handleName: this.handleName
-                },
-                userCode: this.settings.letUserCode,
-                socketCode: this.socketCode
-            });
-            this.webSocketSend(params);
-            this.winMaxMinOpt();
-        }
-        // 录像回放 //paramsArr传开始时间,结束时间,通道号
+        this.createVideoDialog(this.vModeObj);
+    }
+    // 实时预览视频
+    realTimeVideo(arr = [{
+        "channelId": ""
+    }]) {
+        //  debugger
+        const params = JSON.stringify({
+            "loginIp": this.settings.letLoginIp,
+            "method": "openVideo",
+            "params": {
+                "array": arr, // [{"channelId": channelId}]
+                "handleName": this.handleName
+            },
+            "userCode": this.settings.letUserCode,
+            "socketCode": this.socketCode
+        });
+        this.webSocketSend(params);
+        this.winMaxMinOpt();
+    }
+    // 录像回放 //paramsArr传开始时间,结束时间,通道号
     playBack(paramsArr) {
+        this.resize();
+        const params = JSON.stringify({
+            "loginIp": this.settings.letLoginIp,
+            "method": "openRecord",
+            "params": {
+                "array": paramsArr, // [{"beginTime": "2019-12-27 00:00:00","channelId": "mA2I9l1kA1BOPTAPHT74P8","endTime": "2019-12-27 23:59:59"}]
+                "handleName": this.handleName
+            },
+            "userCode": this.settings.letUserCode,
+            "socketCode": this.socketCode
+        });
+        this.webSocketSend(params);
+        this.winMaxMinOpt();
+        setTimeout(() => {
             this.resize();
-            const params = JSON.stringify({
-                loginIp: this.settings.letLoginIp,
-                method: "openRecord",
-                params: {
-                    array: paramsArr, // [{"beginTime": "2019-12-27 00:00:00","channelId": "mA2I9l1kA1BOPTAPHT74P8","endTime": "2019-12-27 23:59:59"}]
-                    handleName: this.handleName
-                },
-                userCode: this.settings.letUserCode,
-                socketCode: this.socketCode
-            });
-            this.webSocketSend(params);
-            this.winMaxMinOpt();
-            setTimeout(() => {
-                this.resize();
-            }, 1000);
-        }
-        // 关闭客户端
+        }, 1000);
+    }
+    // 关闭客户端
     closeClient() {
-            const params = {
-                loginIp: this.settings.letLoginIp,
-                method: "logout",
-                userCode: this.settings.letUserCode,
-                socketCode: this.socketCode
-            };
-            this.webSocketSend(JSON.stringify(params));
+        const params = {
+            "loginIp": this.settings.letLoginIp,
+            "method": "logout",
+            "userCode": this.settings.letUserCode,
+            "socketCode": this.socketCode
+        };
+        this.webSocketSend(JSON.stringify(params));
 
-            this.stopWebSocket();
-            this.websocket = null;
-        }
-        // debug(message) { // 客户端调试返回信息操作
-        //     debugTextArea.value += message + "\n\n";
-        //     debugTextArea.scrollTop = debugTextArea.scrollHeight;
-        // }
+        this.stopWebSocket();
+        this.websocket = null;
+    }
+    // debug(message) { // 客户端调试返回信息操作
+    //     debugTextArea.value += message + "\n\n";
+    //     debugTextArea.scrollTop = debugTextArea.scrollHeight;
+    // }
     sendMessage() {
         const msg = document.getElementById("inputText").value;
         const strToSend = msg;
@@ -430,151 +356,159 @@ class VideoPlay {
         }
     }
     stopWebSocket() {
-            if (this.websocket) {
-                this.websocket.close();
-            }
-            this.websocket = null;
+        if (this.websocket) {
+            this.websocket.close();
         }
-        // 客户端显示隐藏操作;
+        this.websocket = null;
+    }
+    // 客户端显示隐藏操作;
     showBrower(flag) {
-            const params = {
-                loginIp: this.settings.letLoginIp,
-                method: "whetherShowVideoWnd",
-                params: {
-                    bShow: flag,
-                    handleName: this.handleName
-                },
-                userCode: this.settings.letUserCode,
-                socketCode: this.socketCode
-            };
-            this.display = flag;
-            this.status = flag;
-            console.log(flag);
-            this.resize(); // 隐藏时候不走resize,显示时候感知下位置,但是,这不能加延时,否则切换标签页有问题。
-            this.webSocketSend(JSON.stringify(params));
-        }
-        // 客户端-释放窗口
+        const params = {
+            "loginIp": this.settings.letLoginIp,
+            "method": "whetherShowVideoWnd",
+            "params": {
+                "bShow": flag,
+                "handleName": this.handleName
+            },
+            "userCode": this.settings.letUserCode,
+            "socketCode": this.socketCode
+        };
+        this.display = flag;
+        this.status = flag;
+        this.resize(); // 隐藏时候不走resize,显示时候感知下位置,但是,这不能加延时,否则切换标签页有问题。
+        this.webSocketSend(JSON.stringify(params));
+    }
+    // 客户端-释放窗口
     destroyVideoDialog() {
-            const params = {
-                loginIp: this.settings.letLoginIp,
-                method: "DestroyVideoDialog",
-                params: {
-                    handleName: this.handleName
-                },
-                userCode: this.settings.letUserCode,
-                socketCode: this.socketCode
-            };
-            this.webSocketSend(JSON.stringify(params));
-        }
-        // 视频置顶操作
+        const params = {
+            "loginIp": this.settings.letLoginIp,
+            "method": "DestroyVideoDialog",
+            "params": {
+                "handleName": this.handleName
+            },
+            "userCode": this.settings.letUserCode,
+            "socketCode": this.socketCode
+        };
+        this.webSocketSend(JSON.stringify(params));
+    }
+    // 视频置顶操作
     setVideoWndOnTop(flag) {
-            const params = {
-                loginIp: this.settings.letLoginIp,
-                method: "setVideoWndOnTop",
-                params: {
-                    bOnTop: flag,
-                    handleName: this.handleName
-                },
-                userCode: this.settings.letUserCode,
-                socketCode: this.socketCode
-            };
-            this.webSocketSend(JSON.stringify(params));
-        }
-        // 最大化最小化操作;
+        const params = {
+            "loginIp": this.settings.letLoginIp,
+            "method": "setVideoWndOnTop",
+            "params": {
+                "bOnTop": flag,
+                "handleName": this.handleName
+            },
+            "userCode": this.settings.letUserCode,
+            "socketCode": this.socketCode
+        };
+        this.webSocketSend(JSON.stringify(params));
+    }
+    // 最大化最小化操作;
     winMaxMinOpt() {
-            if (document.addEventListener) {
-                // debugger;
-                document.addEventListener("webkitvisibilitychange", () => {
-                    // debugger;
-                    if (document.webkitVisibilityState === "hidden") {
-                        // 最小化
-                        const temp = this.status;
-                        this.showBrower(false);
-                        this.status = temp;
-                        console.log("hidden");
-                    } else if (document.webkitVisibilityState === "visible") {
-                        // 最大化
-                        // 延时的目的:最大化的瞬间 走resize中的window.outerWidth - window.innerWidth < 0这个条件,缺少浏览器顶部栏的高度,导致高度上移
-                        console.log("visible");
-                        setTimeout(() => {
-                            this.showBrower(this.status);
-                        }, 200);
-                    }
-                });
-            }
-        }
-        // 关闭所有视频
-    closeAllVideo() {
-            const params = JSON.stringify({
-                loginIp: this.settings.letLoginIp,
-                method: "closeVideo",
-                userCode: this.settings.letUserCode,
-                params: {
-                    handleName: this.handleName
-                },
-                socketCode: this.socketCode
+        if (document.addEventListener) {
+            document.addEventListener("webkitvisibilitychange", () => {
+                if (document.webkitVisibilityState === "hidden") { // 最小化
+                    const temp = this.status;
+                    this.showBrower(false);
+                    this.status = temp;
+                    console.log("hidden");
+                } else if (document.webkitVisibilityState === "visible") { // 最大化
+                    // 延时的目的:最大化的瞬间 走resize中的window.outerWidth - window.innerWidth < 0这个条件,缺少浏览器顶部栏的高度,导致高度上移
+                    console.log("visible");
+                    setTimeout(() => {
+                        this.showBrower(this.status);
+                    }, 200);
+                }
             });
-            this.webSocketSend(params);
         }
-        // 拉app视频
+    }
+    // 关闭所有视频
+    closeAllVideo() {
+        const params = JSON.stringify({
+            "loginIp": this.settings.letLoginIp,
+            "method": "closeVideo",
+            "userCode": this.settings.letUserCode,
+            "params": {
+                "handleName": this.handleName
+            },
+            "socketCode": this.socketCode
+        });
+        this.webSocketSend(params);
+    }
+    // 拉app视频
     openAppVideo(paramsArr) {
-            const params = JSON.stringify({
-                loginIp: this.settings.letLoginIp,
-                method: "openAppVideo",
-                params: {
-                    handleName: this.handleName,
-                    array: paramsArr
-                },
-                userCode: this.settings.letUserCode,
-                socketCode: this.socketCode
-            });
-            this.webSocketSend(params);
-        }
-        // 设置窗口分割数
+        const params = JSON.stringify({
+            "loginIp": this.settings.letLoginIp,
+            "method": "openAppVideo",
+            "params": {
+                "handleName": this.handleName,
+                "array": paramsArr
+                /* [
+					{
+
+						"channelId": "AcqRGNrqA1B15042F6AMEO",
+
+						"userCode": "xxxxxx",
+
+						"regionId": "xxxxx",
+
+						"domainId": "xxxxx",
+					}
+
+				] */
+            },
+            "userCode": this.settings.letUserCode,
+            "socketCode": this.socketCode
+        });
+        this.webSocketSend(params);
+    }
+    // 设置窗口分割数
     setDesignDivision(rows, cols) {
-            const params = JSON.stringify({
-                loginIp: this.settings.letLoginIp,
-                method: "SetDesignDivision",
-                userCode: this.settings.letUserCode,
-                params: {
-                    handleName: this.handleName,
-                    rows: Number(rows),
-                    cols: Number(cols)
-                },
-                socketCode: this.socketCode
-            });
-            this.webSocketSend(params);
-        }
-        // 设置视频双击后位置大小
+        const params = JSON.stringify({
+            "loginIp": this.settings.letLoginIp,
+            "method": "SetDesignDivision",
+            "userCode": this.settings.letUserCode,
+            "params": {
+                "handleName": this.handleName,
+                "rows": Number(rows),
+                "cols": Number(cols)
+            },
+            "socketCode": this.socketCode
+        });
+        this.webSocketSend(params);
+    }
+    // 设置视频双击后位置大小
     setDesignDivision(obj) {
-            const { width = "0", height = "0", posX = "0", posY = "0" } = obj;
-            const params = JSON.stringify({
-                loginIp: this.settings.letLoginIp,
-                method: "expendVideoCtrl",
-                userCode: this.settings.letUserCode,
-                params: {
-                    handleName: this.handleName,
-                    expend: true,
-                    width: width,
-                    height: height,
-                    posX: posX,
-                    posY: posY
-                },
-                socketCode: this.socketCode
-            });
-            this.webSocketSend(params);
-        }
-        // 通用方法第三方传方法名和参数体
+        const {
+            width = "0", height = "0", posX = "0", posY = "0"
+        } = obj;
+        const params = JSON.stringify({
+            "loginIp": this.settings.letLoginIp,
+            "method": "expendVideoCtrl",
+            "userCode": this.settings.letUserCode,
+            "params": {
+                "handleName": this.handleName,
+                "expend": true,
+                "width": width,
+                "height": height,
+                "posX": posX,
+                "posY": posY,
+            },
+            "socketCode": this.socketCode
+        });
+        this.webSocketSend(params);
+    }
+    // 通用方法第三方传方法名和参数体
     commonUse(method, paramsObj) {
         const params = JSON.stringify({
-            loginIp: this.settings.letLoginIp,
-            method: method,
-            userCode: this.settings.letUserCode,
-            params: paramsObj,
-            socketCode: this.socketCode
+            "loginIp": this.settings.letLoginIp,
+            "method": method,
+            "userCode": this.settings.letUserCode,
+            "params": paramsObj,
+            "socketCode": this.socketCode
         });
         this.webSocketSend(params);
     }
-}
-
-window.VideoPlay = VideoPlay;
+}

+ 20 - 2
src/components/MarkerMap/dialog.ts

@@ -65,7 +65,7 @@ export const GET_VIDEO_DIALOG_HTML = (
     name,
     addr,
   }: MarkerType,
-  callback = () => {},
+  callback = (type=1) => {},
 ) => {
   const el = document.createElement('div');
   el.innerHTML = `
@@ -85,9 +85,27 @@ export const GET_VIDEO_DIALOG_HTML = (
   button.className = 'el-button el-button--primary el-button--small';
   button.innerHTML = '查看';
   action.appendChild(button);
-  button.addEventListener('click', callback);
+  button.addEventListener('click', ()=>{
+    callback(1)
+  });
+
+  const button2 = document.createElement('button');
+  button2.className = 'el-button el-button--primary el-button--small';
+  button2.innerHTML = '监测';
+  action.appendChild(button2);
+  button2.addEventListener('click', ()=>{
+    callback(2)
+
+  });
 
   el.appendChild(action);
+
+
+  // const action2 = document.createElement('div');
+  // action.className = 'action action2';
+  
+
+  // el.appendChild(action2);
   return el;
 };
 

+ 147 - 20
src/components/MarkerMap/index.tsx

@@ -280,17 +280,42 @@ export default defineComponent({
                         //  console.log(memberObj);
                         //  meetObj.mebmber.push(memberObj);
 
-            const DAHUA = document.getElementById('DAHUA') as HTMLIFrameElement;
-            DAHUA?.contentWindow?.postMessage(
-              {
-                key: 'danbing',
-                value: marker['userId'],
-                deviceId: marker['deviceCode'],
-                channelId: marker['channelId'],
-              },
-              '*',
-            );
-            daHuaStore.dahuaUserVisible = true;
+                        mainstore.videoisshow = true;
+                        mainstore.videotitle = marker['name'] + "";
+                       
+                        // try {
+                          const meeting = new Meeting();
+                          const channelid = marker['channelId']+"";
+                          // console.log(channelid)
+                          // const channelid = "lJmfmlS0A1DJAUR812D9MV";
+                          // console.log(channelid)
+          
+                          meeting.closeVideo();
+                          meeting.closeClient();
+                         
+                          // meeting.deleteMeeting();
+          
+                          meeting.openClient(() => {
+                            meeting.playVideo({
+                              type: 'single',
+                              deviceId: marker['deviceCode'],
+                              channelId: channelid,
+                            });
+                          });
+          
+                          mainstore.videohandle = meeting;
+
+            // const DAHUA = document.getElementById('DAHUA') as HTMLIFrameElement;
+            // DAHUA?.contentWindow?.postMessage(
+            //   {
+            //     key: 'danbing',
+            //     value: marker['userId'],
+            //     deviceId: marker['deviceCode'],
+            //     channelId: marker['channelId'],
+            //   },
+            //   '*',
+            // );
+            // daHuaStore.dahuaUserVisible = true;
 
             // console.log(daHuaStore.deviceUser);
           };
@@ -308,30 +333,132 @@ export default defineComponent({
           return GET_TEAM_DIALOG_HTML(marker);
 
         case '视频监控':
-          return GET_VIDEO_DIALOG_HTML(marker, () => {
+          return GET_VIDEO_DIALOG_HTML(marker, (type=1) => {
             if (marker['status'] == 1) {
               // mainstore.videourl =
               //   (import.meta.env.VITE_DH_SERVER as string) +
               //   '/videoplay.html?channelId=' +
               //   marker['deviceCode'];
-              mainstore.videoisshow = true;
+              const channelid = marker['channelId']+"";
+              if(type==1){
+                mainstore.videoisshow = true;
               mainstore.videotitle = marker['name'] + "";
-              // try {
-                const meeting = new Meeting();
-                const channelid = marker['deviceCode'];
+            
+              
+           
+             if(window.metting){
+              const meeting = window.metting;
+              meeting.settargetId("vPlayArea");
+                meeting.playVideo({
+                  type: 'single',
+                  deviceId: marker['deviceCode'],
+                  channelId: channelid,
+                });
+                setTimeout(() => {
+                  try{
+                    if(window.vPlayArea){
+                      window.vPlayArea.resize();
+                      window.vPlayArea.dragResize(0,0,0,0)
+                  }
+                  }catch(E){
+                  }
+                  
+                }, 500);
+                
 
-                meeting.closeClient();
-                meeting.closeVideo();
-                meeting.deleteMeeting();
+             }else{
+              const meeting = new Meeting();
+              if(window.theSocket){
+                meeting.settargetId("vPlayArea");
+                meeting.playVideo({
+                  type: 'single',
+                  deviceId: marker['deviceCode'],
+                  channelId: channelid,
+                });
+                window.metting = meeting;
+                setTimeout(() => {
+                  try{
+                    if(window.vPlayArea){
+                      window.vPlayArea.resize();
+                      window.vPlayArea.dragResize(0,0,0,0)
+                  }
+                  }catch(E){
+                  }
+                  
+                }, 500);
 
+              }else{
                 meeting.openClient(() => {
+                
+                  meeting.settargetId("vPlayArea");
                   meeting.playVideo({
                     type: 'single',
-                    deviceId: channelid,
+                    deviceId: marker['deviceCode'],
                     channelId: channelid,
                   });
+                  window.metting = meeting;
+
+                  setTimeout(() => {
+                    try{
+                      if(window.vPlayArea){
+                        window.vPlayArea.resize();
+                        window.vPlayArea.dragResize(0,0,0,0)
+                    }
+                    }catch(E){
+                    }
+                    
+                  }, 1000);
+                  
+               
                 });
 
+              }
+
+              }
+              
+
+             
+
+             }
+             if(type==2){
+              window.indexp = (window.indexp == 1?2:1);
+              const meeting = new Meeting();
+              if(window.theSocket){
+                meeting.settargetId("relvideo"+window.indexp);
+                meeting.playVideo({
+                  type: 'single',
+                  deviceId: marker['deviceCode'],
+                  channelId: channelid,
+                });
+
+              }else{
+                meeting.openClient(() => {
+                  meeting.settargetId("relvideo"+window.indexp);
+                  meeting.playVideo({
+                    type: 'single',
+                    deviceId: marker['deviceCode'],
+                    channelId: channelid,
+                  });
+                });
+              }
+            }
+              
+              // // try {
+              //   const meeting = new Meeting();
+               
+              //   meeting.closeVideo();
+
+              //   meeting.openClient(() => {
+              //     meeting.settargetId("");
+              //     meeting.playVideo({
+              //       type: 'single',
+              //       deviceId: marker['deviceCode'],
+              //       channelId: channelid,
+              //     });
+              //   });
+
+                // mainstore.videohandle = meeting;
+
               // } catch (E) { }
              
               // const DAHUA = document.getElementById('DAHUA') as HTMLIFrameElement;

+ 10 - 6
src/layout/BaseLayout/index.scss

@@ -24,10 +24,10 @@
         height: px2rem(400px * 2);
         position: absolute;
         left: 40%;
-        top: 50%;
-        z-index: 1;
-        padding: px2rem(24px * 2);
-        padding-top: px2rem(80px * 2);
+        top: 30%;
+        z-index: 11;
+        // padding: px2rem(24px * 2);
+        // padding-top: px2rem(80px * 2);
         .title {
             position: absolute;
             top: px2rem(0px * 2);
@@ -46,8 +46,12 @@
             }
         }
         #vPlayArea {
-            width: 100%;
-            height: 100%;
+            // background: red;
+            position: absolute;
+            top:px2rem(80px * 2);
+            left:px2rem(20px * 2);
+            width: px2rem(500px * 2);
+            height: px2rem(310px * 2);
         }
     }
     header {

+ 75 - 13
src/layout/BaseLayout/index.tsx

@@ -1,8 +1,8 @@
-import { defineComponent, onMounted, watchEffect,ref } from "vue";
+import { defineComponent, onMounted, watchEffect, ref } from "vue";
 import { RouterView, useRoute, useRouter } from 'vue-router';
 import MarkerMap from '@/components/MarkerMap';
 import './index.scss';
-import { useIncidentStore, useDaHuaStore,useMainStore } from '@/store';
+import { useIncidentStore, useDaHuaStore, useMainStore } from '@/store';
 import { constants } from 'zlib';
 import clsx from "clsx";
 import moment from 'moment';
@@ -133,10 +133,10 @@ export default defineComponent({
 
     const mainStore = useMainStore();
 
-    const sqdh = ref(import.meta.env.VITE_DH_SERVER as string+"/index.html");
+    const sqdh = ref(import.meta.env.VITE_DH_SERVER as string + "/index.html");
 
     const markmap = ref(null);
-    
+
     console.log(sqdh.value);
 
 
@@ -153,7 +153,65 @@ export default defineComponent({
 
     // login da hua
     onMounted(() => {
+
+      var dv = document.getElementsByClassName('videoifram')[0];
+      var x = 0;
+      var y = 0;
+      var l = 0;
+      var t = 0;
+      var isDown = false;
+      //鼠标按下事件
+      dv.onmousedown = function (e) {
+        //获取x坐标和y坐标
+        x = e.clientX;
+        y = e.clientY;
+
+        //获取左部和顶部的偏移量
+        l = dv.offsetLeft;
+        t = dv.offsetTop;
+        //开关打开
+        isDown = true;
+        //设置样式  
+        dv.style.cursor = 'move';
+      }
+      //鼠标移动
+      window.onmousemove = function (e) {
+        if (isDown == false) {
+          return;
+        }
+        //获取x和y
+        var nx = e.clientX;
+        var ny = e.clientY;
+        //计算移动后的左偏移量和顶部的偏移量
+        var nl = nx - (x - l);
+        var nt = ny - (y - t);
+
+        dv.style.left = nl + 'px';
+        dv.style.top = nt + 'px';
+        setTimeout(() => {
+          try{
+            console.log(window.vPlayArea)
+            if(window.vPlayArea){
+              window.vPlayArea.dragResize(0,0,0,0)
+          }
+          }catch(E){
+            console.log(E)
+          }
+          
+        }, 1);
+       
+          
+          
       
+
+      }
+      //鼠标抬起事件
+      dv.onmouseup = function () {
+        //开关关闭
+        isDown = false;
+        dv.style.cursor = 'default';
+      }
+
       // if (!localStorage.getItem('DAHUA_token')) {
       //   daHuaStore.DAHUALogin();
       // } else {
@@ -202,9 +260,9 @@ export default defineComponent({
         }
       }, false);
 
-      (yjzh_btn.value)?.addEventListener("click", () => { 
+      (yjzh_btn.value)?.addEventListener("click", () => {
 
-       handleDaHuaSystem();
+        handleDaHuaSystem();
 
       })
 
@@ -213,14 +271,14 @@ export default defineComponent({
     const datetext = ref('-');
     const weektext = ref('-');
     // debugger
-    setInterval(() => { 
+    setInterval(() => {
       datetext.value =
-        moment().format('YYYY年MM月DD日') ; 
+        moment().format('YYYY年MM月DD日');
       weektext.value = moment().format('dddd');
       timetext.value = moment().format('HH:mm:ss');
 
     }, 1000)
-    
+
     const yjzh_btn = ref(null);
 
     return () => (
@@ -238,11 +296,15 @@ export default defineComponent({
         <div
           class="videoifram"
           style={mainStore.videoisshow ? 'display:block' : 'display:none'}
-          onClick={() => {
+         >
+          <div class="title">{mainStore.videotitle}</div>
+          <div class="closebtn"  onClick={() => {
             mainStore.videoisshow = false;
+            if(window.metting){
+              window.metting.closeVideo();
+            }
+            
           }}>
-          <div class="title">{mainStore.videotitle}</div>
-          <div class="closebtn">
             <img src={closeicon} />
           </div>
           <div id="vPlayArea" ></div>
@@ -260,7 +322,7 @@ export default defineComponent({
           <MarkerMap
             readonly={route.path.includes('incidentDetail')}
             ref={markmap}
-            // marker={store.incidentDetail}
+          // marker={store.incidentDetail}
           />
 
           <div class="yjld_btn" ref={yjzh_btn}></div>

+ 2 - 2
src/store/useMainStore.ts

@@ -13,7 +13,7 @@ export interface MainStateType {
   cancelReqToken: Canceler[];
   userInfo: Omit<UserInfo, 'accessToken'>;
   isshoweventlist: Boolean;
-  videourl: string;
+  videohandle: any;
   videoisshow: Boolean;
   videotitle: string;
 }
@@ -32,7 +32,7 @@ export default defineStore<'main', MainStateType, {}, MainActionsType>('main', {
     cancelReqToken: [],
     userInfo: {},
     isshoweventlist: false,
-    videourl: "",
+    videohandle: {},
     videoisshow: false,
     videotitle:"-",
   }),

+ 9 - 0
src/views/IncidentDetail/LiveMonitoringCard/index.tsx

@@ -23,16 +23,25 @@ export default defineComponent({
     return () => (
       <Card cardType="live-monitoring">
         <div class="livec">
+          <div id="relvideo1"  style="width: 100%;height: 100%;">
           <img
             style="width: 100%;height: 100%;"
             src="https://img1.baidu.com/it/u=1650334584,1209303936&fm=253&fmt=auto&app=120&f=JPEG?w=1129&h=642"
           />
+
+
+          </div>
+         
         </div>
         <div class="livec">
+        <div id="relvideo2"  style="width: 100%;height: 100%;">
           <img
             style="width: 100%;height: 100%;"
             src="https://img1.baidu.com/it/u=1650334584,1209303936&fm=253&fmt=auto&app=120&f=JPEG?w=1129&h=642"
           />
+
+
+          </div>
         </div>
       </Card>
     );