From f199a65948775d8561f1233894a7f8c3629ffbb5 Mon Sep 17 00:00:00 2001 From: SaltFish <42058801+SaltFish001@users.noreply.github.com> Date: Wed, 23 Feb 2022 23:58:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A4=E6=96=AD=E5=BD=93=E5=89=8D=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E5=8D=8F=E8=AE=AE=E9=80=89=E6=8B=A9=E6=92=AD=E6=94=BE?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在https页面下会因为使用ws_flv连接导致播放失败, 所以对当前页面的协议进行判断 --- web_src/src/components/live.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/web_src/src/components/live.vue b/web_src/src/components/live.vue index beab9e45..d3c1f6df 100644 --- a/web_src/src/components/live.vue +++ b/web_src/src/components/live.vue @@ -178,7 +178,11 @@ 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(window.location.protocol === 'https:'){ + that.setPlayUrl(res.data.data.wss_flv,idxTmp) + } else { + that.setPlayUrl(res.data.data.ws_flv,idxTmp) + } }else { that.$message.error(res.data.msg); }