优化分屏监控播放体验

pull/1653/head
648540858 2024-10-21 10:51:13 +08:00
parent 36409eb34c
commit 7e013f1aa7
1 changed files with 6 additions and 3 deletions

View File

@ -22,8 +22,8 @@
gridTemplateRows: layout[spiltIndex].rows, gap: '4px', backgroundColor: '#a9a8a8'}"> gridTemplateRows: layout[spiltIndex].rows, gap: '4px', backgroundColor: '#a9a8a8'}">
<div v-for="i in layout[spiltIndex].spilt" :key="i" class="play-box" :class="getPlayerClass(spiltIndex, i)" <div v-for="i in layout[spiltIndex].spilt" :key="i" class="play-box" :class="getPlayerClass(spiltIndex, i)"
@click="playerIdx = (i-1)"> @click="playerIdx = (i-1)">
<div v-if="!videoUrl[i-1]" style="color: #ffffff;font-size: 15px;font-weight: bold;"></div> <div v-if="!videoUrl[i-1]" style="color: #ffffff;font-size: 15px;font-weight: bold;">{{videoTip[i-1]?videoTip[i-1]:""}}</div>
<player ref="player" v-else :videoUrl="videoUrl[i-1]" fluent autoplay @screenshot="shot" <player :ref="'player'[i-1]" v-else :videoUrl="videoUrl[i-1]" fluent autoplay @screenshot="shot"
@destroy="destroy"/> @destroy="destroy"/>
</div> </div>
</div> </div>
@ -48,6 +48,7 @@ export default {
data() { data() {
return { return {
videoUrl: [''], videoUrl: [''],
videoTip: [''],
spiltIndex: 2,// spiltIndex: 2,//
playerIdx: 0,// playerIdx: 0,//
@ -168,6 +169,8 @@ export default {
this.save(channelId) this.save(channelId)
let idxTmp = this.playerIdx let idxTmp = this.playerIdx
this.setPlayUrl("", idxTmp);
this.$set(this.videoTip, idxTmp, "正在拉流...")
this.$axios({ this.$axios({
method: 'get', method: 'get',
url: '/api/common/channel/play', url: '/api/common/channel/play',
@ -184,7 +187,7 @@ export default {
} }
this.setPlayUrl(videoUrl, idxTmp); this.setPlayUrl(videoUrl, idxTmp);
} else { } else {
this.$message.error(res.data.msg); this.$set(this.videoTip, idxTmp, "播放失败: " + res.data.msg)
} }
}).catch(function (e) { }).catch(function (e) {
}).finally(() => { }).finally(() => {