优化分屏监控播放体验
parent
36409eb34c
commit
7e013f1aa7
|
@ -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(() => {
|
||||||
|
|
Loading…
Reference in New Issue