北京经济技术开发区经开区虚拟城市项目-【前端】-移动端Web
lixuliang
2024-01-19 af75ade1f36ae099d454ffa4f052b704cf7e02e1
static/video/video.html
@@ -75,7 +75,6 @@
                    url: "https://skyzt.bda.gov.cn/BEApi/getCamerasInfo?cameraIndexCode=" + code, success: function (result) {
                        try {
                            var data = JSON.parse(result);
                            realplay(data.data.url);
                            let res;
                            if (data.data.url.includes("41")) {
                                res = data.data.url.replace("ws://10.117.5.41:559/", "wss://skyzt.bda.gov.cn:443/")
@@ -89,11 +88,11 @@
                                res = data.data.url.replace("ws://10.117.5.46:559/", "wss://skyzt.bda.gov.cn:443/")
                            } else if (data.data.url.includes("47")) {
                                res = data.data.url.replace("ws://10.117.5.47:559/", "wss://skyzt.bda.gov.cn:443/")
                            } else if (data.data.url.includes("206")) {
                                res = data.data.url.replace("ws://10.117.5.28:559/", "wss://skyzt.bda.gov.cn:443/")//视频最新返回地址
                            }
                            realplay(res);
                        } catch (e) {
                        }
                        } catch (e) { }
                    }
                });
            }
@@ -114,31 +113,35 @@
            })
            setSize()
        }
        function arrangeWindow() {
            let splitNum = 1
            this.player.JS_ArrangeWindow(splitNum).then(
                () => { console.log(`arrangeWindow to ${splitNum}x${splitNum} success`) },
                e => { console.error(e) }
            )
        }
        function wholeFullScreen() {
            this.player.JS_FullScreenDisplay(true).then(
                () => { console.log(`wholeFullScreen success`) },
                e => { console.error(e) }
            )
        }
        // function arrangeWindow() {
        //     let splitNum = 1
        //     this.player.JS_ArrangeWindow(splitNum).then(
        //         () => { console.log(`arrangeWindow to ${splitNum}x${splitNum} success`) },
        //         e => { console.error(e) }
        //     )
        // }
        // function wholeFullScreen() {
        //     this.player.JS_FullScreenDisplay(true).then(
        //         () => { console.log(`wholeFullScreen success`) },
        //         e => { console.error(e) }
        //     )
        // }
        /* 预览&对讲 */
        function realplay(url) {
            var mode = 1;
            var index = player.currentWindowIndex;
            var playURL = url;
            player.JS_Play(playURL, { playURL, mode }, index).then(
                () => { console.log('realplay success') },
                e => { console.error(e); }
                () => {
                    console.log('realplay success')
                },
                e => {
                    console.error(e);
                }
            )
        }
        $(function () {
            // init();
            init();
        });
    </script>
</body>