判断当前页面协议选择播放连接

在https页面下会因为使用ws_flv连接导致播放失败, 所以对当前页面的协议进行判断
pull/343/head
SaltFish 2022-02-23 23:58:49 +08:00 committed by GitHub
parent 2157bb0270
commit f199a65948
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -178,7 +178,11 @@
console.log(res) console.log(res)
if (res.data.code == 0 && res.data.data) { if (res.data.code == 0 && res.data.data) {
itemData.playUrl = res.data.data.httpsFlv 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 { }else {
that.$message.error(res.data.msg); that.$message.error(res.data.msg);
} }