|
|
@@ -148,8 +148,8 @@ export default {
|
|
|
console.log('onVideoPlay')
|
|
|
this.paused = false
|
|
|
if (this.loading) {
|
|
|
- clearTimeout(this.$timer)
|
|
|
this.loading = false
|
|
|
+ clearTimeout(this.$timer)
|
|
|
if (this.needPause) {
|
|
|
this.$player.pause()
|
|
|
}
|
|
|
@@ -160,27 +160,27 @@ export default {
|
|
|
this.paused = true
|
|
|
},
|
|
|
onTimeUpdate () {
|
|
|
+ console.log('onTimeUpdate')
|
|
|
if (this.loading) {
|
|
|
- clearTimeout(this.$timer)
|
|
|
- const video = this.$refs.video
|
|
|
- console.log('onTimeUpdate', video?.duration, video?.currentTime)
|
|
|
this.loading = false
|
|
|
+ clearTimeout(this.$timer)
|
|
|
}
|
|
|
},
|
|
|
onVideoWaiting () {
|
|
|
console.log('onVideoWaiting')
|
|
|
if (!this.loading) {
|
|
|
this.loading = true
|
|
|
- this.$timer = setTimeout(() => {
|
|
|
- if (this.loading) {
|
|
|
- this.destroyPlayer()
|
|
|
- this.$message({
|
|
|
- type: 'warning',
|
|
|
- message: '暂未获取到视频流'
|
|
|
- })
|
|
|
- }
|
|
|
- }, 10000)
|
|
|
}
|
|
|
+ clearTimeout(this.$timer)
|
|
|
+ this.$timer = setTimeout(() => {
|
|
|
+ if (this.loading) {
|
|
|
+ this.destroyPlayer()
|
|
|
+ this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: '暂未获取到视频流'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }, 10000)
|
|
|
},
|
|
|
onVideoError (e) {
|
|
|
console.log('onVideoError', e)
|