mirror of
https://github.com/cuiocean/ZY-Player.git
synced 2026-05-05 19:31:21 +08:00
🎀 新增窗口最小化, 暂停视频. 从最小化恢复窗口, 视频播放
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user