Commit aae7c80fd5c6d89fb392e86648920db6c79eca51
1 parent
189b6044
fix(live): 修复分屏监控 HTTPS 环境下无法播放的问题
Showing
1 changed file
with
8 additions
and
2 deletions
web_src/src/components/live.vue
| ... | ... | @@ -138,8 +138,14 @@ export default { |
| 138 | 138 | url: '/api/play/start/' + deviceId + '/' + channelId |
| 139 | 139 | }).then(function (res) { |
| 140 | 140 | if (res.data.code === 0 && res.data.data) { |
| 141 | - itemData.playUrl = res.data.data.httpsFlv | |
| 142 | - that.setPlayUrl(res.data.data.ws_flv, idxTmp) | |
| 141 | + let videoUrl; | |
| 142 | + if (location.protocol === "https:") { | |
| 143 | + videoUrl = res.data.data.wss_flv; | |
| 144 | + } else { | |
| 145 | + videoUrl = res.data.data.ws_flv; | |
| 146 | + } | |
| 147 | + itemData.playUrl = videoUrl; | |
| 148 | + that.setPlayUrl(videoUrl, idxTmp); | |
| 143 | 149 | } else { |
| 144 | 150 | that.$message.error(res.data.msg); |
| 145 | 151 | } | ... | ... |