🎀 新增窗口最小化, 暂停视频. 从最小化恢复窗口, 视频播放

This commit is contained in:
Hunlongyu
2020-10-19 16:57:32 +08:00
parent 11e7ffc554
commit 7d6c5482af

View File

@@ -1025,6 +1025,19 @@ export default {
this.right.list = []
this.showNext = false
this.xg = new Hls(this.config)
},
minMaxEvent () {
const win = remote.getCurrentWindow()
win.on('minimize', () => {
if (this.xg) {
this.xg.pause()
}
})
win.on('restore', () => {
if (this.xg) {
this.xg.play()
}
})
}
},
created () {
@@ -1071,6 +1084,7 @@ export default {
})
})
this.bindEvent()
this.minMaxEvent()
},
beforeDestroy () {
clearInterval(this.timer)