|
|
@@ -64,10 +64,7 @@ export default {
|
|
|
hasVideo: true,
|
|
|
url
|
|
|
})
|
|
|
- player.on(mpegtsjs.Events.ERROR, e => {
|
|
|
- console.log('mpegtsjs', mpegtsjs.Events.ERROR, e)
|
|
|
- this.destroyPlayer()
|
|
|
- })
|
|
|
+ player.on(mpegtsjs.Events.ERROR, this.onVideoError)
|
|
|
// player.on(mpegtsjs.Events.RECOVERED_EARLY_EOF, e => {
|
|
|
// console.log('mpegtsjs', mpegtsjs.Events.RECOVERED_EARLY_EOF, e)
|
|
|
// })
|
|
|
@@ -191,11 +188,15 @@ export default {
|
|
|
clearTimeout(this.$timer)
|
|
|
this.$timer = setTimeout(() => {
|
|
|
if (this.loading || this.waiting) {
|
|
|
- this.destroyPlayer()
|
|
|
- this.$message({
|
|
|
- type: 'warning',
|
|
|
- message: '暂未获取到视频流'
|
|
|
- })
|
|
|
+ if (this.controls) {
|
|
|
+ this.destroyPlayer()
|
|
|
+ this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: '暂未获取到视频流'
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.onVideoError('No Streaming')
|
|
|
+ }
|
|
|
}
|
|
|
}, 10000)
|
|
|
},
|
|
|
@@ -209,6 +210,7 @@ export default {
|
|
|
onVideoError (e) {
|
|
|
console.log('onVideoError', e)
|
|
|
this.destroyPlayer()
|
|
|
+ this.createPlayer()
|
|
|
},
|
|
|
onVideoEnded () {
|
|
|
console.log('onVideoEnd')
|