Commit 4ae81766 authored by 华国豪's avatar 华国豪 🙄

视屏暂停不自动播放问题

parent 50d323b5
......@@ -145,7 +145,7 @@
</div>
</div>
<div class="video_box" :class="movieShow ? 'video_box_show' : ''">
<video v-if="movieShow" @error="videoErr" @ended="nextVideo(true)" style="width:100%;height:100%;" ref="video" :src="movie[movieNum]" autoplay="autoplay" controls="controls">您的浏览器不支持视频播放</video>
<video v-if="movieShow" @error="videoErr" @ended="nextVideo(true)" style="width:100%;height:100%;" id="video" ref="video" :src="movie[movieNum]" autoplay="autoplay" controls="controls">您的浏览器不支持视频播放</video>
</div>
</div>
</template>
......@@ -194,7 +194,7 @@ export default {
movieShow: false,
movieTime: 0,
movieTimmer: null,
fiveMinutes: 1,
fiveMinutes: 300,
};
},
mounted() {
......@@ -235,7 +235,7 @@ export default {
videoErr: function (){
this.movieShow = false
this.movieTime = 0
this.fiveMinutes = 9999
this.fiveMinutes = 99999
},
getMovieTimmer: function () {
if (this.movieTime < this.fiveMinutes) {
......@@ -243,6 +243,11 @@ export default {
} else if (this.movieTime >= this.fiveMinutes && !this.movieShow) {
this.movieShow = true
} else {
let st = document.getElementsByTagName('video')[0].readyState
let play = document.getElementsByTagName('video')[0].paused
if (st == 4 && play) {
document.getElementsByTagName('video')[0].play()
}
return
}
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment