From a890b62fa1bbacd1a6156cbccf59def8b7cfe262 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: 星期一, 08 四月 2024 18:13:33 +0800 Subject: [PATCH] Merge branch '2.7.0' --- web_src/src/components/live.vue | 35 +++++++++++++++++++++-------------- 1 files changed, 21 insertions(+), 14 deletions(-) diff --git a/web_src/src/components/live.vue b/web_src/src/components/live.vue old mode 100644 new mode 100755 index 797be84..4a7af49 --- a/web_src/src/components/live.vue +++ b/web_src/src/components/live.vue @@ -107,20 +107,24 @@ console.log(idx); this.clear(idx.substring(idx.length - 1)) }, - clickEvent: function (data) { - if (data.channelId && data.subCount == 0) { - this.sendDevicePush(data) + clickEvent: function (device, data, isCatalog) { + if (data.channelId && !isCatalog) { + if (device.online === 0) { + this.$message.error('璁惧绂荤嚎!涓嶅厑璁哥偣鎾�'); + }else { + this.sendDevicePush(data) + } } }, - contextMenuEvent: function (data) { + contextMenuEvent: function (device, event, data, isCatalog) { }, //閫氱煡璁惧涓婁紶濯掍綋娴� sendDevicePush: function (itemData) { - if (itemData.status === 0) { - this.$message.error('璁惧绂荤嚎!'); - return - } + // if (itemData.status === 0) { + // this.$message.error('璁惧绂荤嚎!'); + // return + // } this.save(itemData) let deviceId = itemData.deviceId; // this.isLoging = true; @@ -133,12 +137,15 @@ method: 'get', url: '/api/play/start/' + deviceId + '/' + channelId }).then(function (res) { - // that.isLoging = false; - console.log('=====----=====') - console.log(res) - if (res.data.code == 0 && res.data.data) { - itemData.playUrl = res.data.data.httpsFlv - that.setPlayUrl(res.data.data.ws_flv, idxTmp) + if (res.data.code === 0 && res.data.data) { + let videoUrl; + if (location.protocol === "https:") { + videoUrl = res.data.data.wss_flv; + } else { + videoUrl = res.data.data.ws_flv; + } + itemData.playUrl = videoUrl; + that.setPlayUrl(videoUrl, idxTmp); } else { that.$message.error(res.data.msg); } -- Gitblit v1.8.0