From 7d6c5482afc4569e40de3fe06a1bfa72c6e4a177 Mon Sep 17 00:00:00 2001 From: Hunlongyu Date: Mon, 19 Oct 2020 16:57:32 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=80=20=E6=96=B0=E5=A2=9E=E7=AA=97?= =?UTF-8?q?=E5=8F=A3=E6=9C=80=E5=B0=8F=E5=8C=96,=20=E6=9A=82=E5=81=9C?= =?UTF-8?q?=E8=A7=86=E9=A2=91.=20=E4=BB=8E=E6=9C=80=E5=B0=8F=E5=8C=96?= =?UTF-8?q?=E6=81=A2=E5=A4=8D=E7=AA=97=E5=8F=A3,=20=E8=A7=86=E9=A2=91?= =?UTF-8?q?=E6=92=AD=E6=94=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Play.vue | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/components/Play.vue b/src/components/Play.vue index 8e9c014..e125d29 100644 --- a/src/components/Play.vue +++ b/src/components/Play.vue @@ -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)