bugfix: 修复视频切换播放方式无法自动播放的问题
parent
a72ef2db8e
commit
a2c27f2b7e
|
@ -44,7 +44,7 @@ export default {
|
|||
vod: true, // 点播
|
||||
};
|
||||
},
|
||||
props: ['videoUrl', 'error', 'hasAudio', 'height', 'autoPlay'],
|
||||
props: ['videoUrl', 'error', 'hasAudio', 'height'],
|
||||
mounted() {
|
||||
let paramUrl = decodeURIComponent(this.$route.params.url)
|
||||
this.$nextTick(() => {
|
||||
|
@ -56,9 +56,6 @@ export default {
|
|||
this.videoUrl = paramUrl;
|
||||
}
|
||||
this.btnDom = document.getElementById("buttonsBox");
|
||||
if (this.autoPlay) {
|
||||
this.play(this.videoUrl);
|
||||
}
|
||||
})
|
||||
},
|
||||
watch: {
|
||||
|
@ -67,7 +64,8 @@ export default {
|
|||
this.$nextTick(() => {
|
||||
this.play(val);
|
||||
})
|
||||
}
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -453,15 +453,6 @@ export default {
|
|||
playFromStreamInfo: function (realHasAudio, streamInfo) {
|
||||
this.showVideoDialog = true;
|
||||
this.hasaudio = realHasAudio && this.hasaudio;
|
||||
if (this.$refs[this.activePlayer]) {
|
||||
this.$refs[this.activePlayer].play(this.getUrlByStreamInfo(streamInfo))
|
||||
}else {
|
||||
this.$nextTick(() => {
|
||||
this.$refs[this.activePlayer].play(this.getUrlByStreamInfo(streamInfo))
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
close: function () {
|
||||
console.log('关闭视频');
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
@click="playerIdx = (i-1)">
|
||||
<div v-if="!videoUrl[i-1]" style="color: #ffffff;font-size: 30px;font-weight: bold;">{{ i }}</div>
|
||||
<player ref="player" v-else :videoUrl="videoUrl[i-1]" fluent autoplay @screenshot="shot"
|
||||
@destroy="destroy" :auto-play="true"/>
|
||||
@destroy="destroy"/>
|
||||
</div>
|
||||
</div>
|
||||
</el-main>
|
||||
|
|
Loading…
Reference in New Issue