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

视屏暂停不自动播放问题

parent 50d323b5
...@@ -145,7 +145,7 @@ ...@@ -145,7 +145,7 @@
</div> </div>
</div> </div>
<div class="video_box" :class="movieShow ? 'video_box_show' : ''"> <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>
</div> </div>
</template> </template>
...@@ -194,7 +194,7 @@ export default { ...@@ -194,7 +194,7 @@ export default {
movieShow: false, movieShow: false,
movieTime: 0, movieTime: 0,
movieTimmer: null, movieTimmer: null,
fiveMinutes: 1, fiveMinutes: 300,
}; };
}, },
mounted() { mounted() {
...@@ -235,7 +235,7 @@ export default { ...@@ -235,7 +235,7 @@ export default {
videoErr: function (){ videoErr: function (){
this.movieShow = false this.movieShow = false
this.movieTime = 0 this.movieTime = 0
this.fiveMinutes = 9999 this.fiveMinutes = 99999
}, },
getMovieTimmer: function () { getMovieTimmer: function () {
if (this.movieTime < this.fiveMinutes) { if (this.movieTime < this.fiveMinutes) {
...@@ -243,6 +243,11 @@ export default { ...@@ -243,6 +243,11 @@ export default {
} else if (this.movieTime >= this.fiveMinutes && !this.movieShow) { } else if (this.movieTime >= this.fiveMinutes && !this.movieShow) {
this.movieShow = true this.movieShow = true
} else { } 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 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