From 11d927e400659307d4451158d31ff1bcbd693a24 Mon Sep 17 00:00:00 2001 From: jmal Date: Sun, 20 Sep 2020 22:25:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=9A=E6=92=AD=E6=94=BE?= =?UTF-8?q?=E8=A7=86=E5=B1=8F=E6=97=B6=E4=BD=BF=E5=85=B3=E9=97=AD=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E8=87=AA=E5=8A=A8=E6=B6=88=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ShowFile/ShowFile.vue | 1 - src/components/preview/VideoPreview.vue | 80 +++++++++++++++++++++++-- src/views/public/share/shareList.vue | 4 +- src/views/public/share/shareList_m.vue | 7 +-- src/websocket/sockJS.js | 4 -- 5 files changed, 80 insertions(+), 16 deletions(-) diff --git a/src/components/ShowFile/ShowFile.vue b/src/components/ShowFile/ShowFile.vue index 4a481ad..7579764 100644 --- a/src/components/ShowFile/ShowFile.vue +++ b/src/components/ShowFile/ShowFile.vue @@ -885,7 +885,6 @@ } } },ws.headers); - console.log("订阅",'/user/queue/update') }, load () { this.getFileList(true) diff --git a/src/components/preview/VideoPreview.vue b/src/components/preview/VideoPreview.vue index c95a142..3206604 100644 --- a/src/components/preview/VideoPreview.vue +++ b/src/components/preview/VideoPreview.vue @@ -2,7 +2,7 @@
-
+
@@ -10,7 +10,10 @@ + :options="playerOptions" + @playing="onPlayerPlaying" + @ended="onPlayerEnded" + @pause="onPlayerPause">
@@ -81,6 +84,8 @@ export default { }, show: this.status, url: '', + timeout: null, + playing: false, } }, watch: { @@ -102,10 +107,76 @@ export default { } }, methods: { - close(){ + close() { this.show = false this.$emit('update:status', false) - } + }, + onPlayerPlaying(){ + this.playing = true + this.clearTimeout() + this.timeout = setTimeout(this.timeoutFun, 2500) + }, + onPlayerPause(){ + this.closeBarShow = true + this.playing = false + }, + onPlayerEnded(){ + this.closeBarShow = true + this.playing = false + }, + onmousemove() { + if(!this.closeBarShow){ + this.closeBarShow = true + } + this.clearTimeout() + this.timeout = setTimeout(this.timeoutFun, 2500) + }, + onmouseout() { + // console.log('onmouseout') + // this.timeout = null + }, + onmouseleave() { + this.closeBarShow = false + this.clearTimeout() + }, + clearTimeout(){ + if(this.timeout != null){ + clearTimeout(this.timeout) + this.timeout = null + } + }, + timeoutFun(){ + if(this.playing){ + console.log("消失",this.$pc) + if(!this.$pc){ + const closeBar = document.querySelector('.block .close-bar') + closeBar.style.display = "none" + } + this.closeBarShow = false + } + this.clearTimeout() + }, + onmouseenter() { + this.closeBarShow = true + let player = document.querySelector('.video-player.video-player.vjs-custom-skin') + // console.log('player',player) + // if(!player) return; + // this.onhover(function() { + // console.log('124') + // }, player, 2000); + }, + // onhover(fun, obj, time) { + // var s; + // obj.onmouseover = function() { + // console.log('onmouseover') + // s = setTimeout(fun, 1000); + // }; + // obj.onmouseout = function() { + // console.log('onmouseout') + // if(!s) return; + // clearTimeout(s); + // }; + // }, } } @@ -144,6 +215,7 @@ export default { border-style: solid; border-color: transparent transparent transparent #d4d4d475; line-height: 36px; + opacity: 1; transform: rotate(-45deg); } diff --git a/src/views/public/share/shareList.vue b/src/views/public/share/shareList.vue index 3c73fa5..ca85d85 100644 --- a/src/views/public/share/shareList.vue +++ b/src/views/public/share/shareList.vue @@ -36,7 +36,7 @@
-
    +
    • -
        +
        • { - console.log('websocket连接成功!') ws.isConnected = true; - // 订阅系统数据 '/topic/updateData/2/system' - // 订阅合并数据 '/topic/updateData/mergeDate/2' - // 订阅冷水机1号数据 /topic/updateData/2/1101/1 }, (err) => { ws.isConnected = false; // 连接发生错误时的处理函数