From a9d889f7d8bf1a3ef3e6243f054c56dd9815217f Mon Sep 17 00:00:00 2001 From: buvta <12312540+buvta@users.noreply.github.com> Date: Wed, 27 Jan 2021 00:12:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=86=8D=E6=AC=A1=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Play.vue | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/components/Play.vue b/src/components/Play.vue index 26f8f2b..0c114f6 100644 --- a/src/components/Play.vue +++ b/src/components/Play.vue @@ -612,7 +612,7 @@ export default { if (document.querySelector('xg-btn-showhistory')) document.querySelector('xg-btn-showhistory').style.display = 'none' if (document.querySelector('.xgplayer-playbackrate')) document.querySelector('.xgplayer-playbackrate').style.display = 'none' }, - getPlayer (playerType, force = false) { + async getPlayer (playerType, force = false) { if (!force && this.playerType === playerType) return if (this.playerType !== 'flv') { this.xg.src = '' // https://developers.google.com/web/updates/2017/06/play-request-was-interrupted#danger-zone @@ -635,6 +635,7 @@ export default { this.playerInstall() this.bindEvent() this.playerType = playerType + if (this.miniMode) { await this.saveMiniWindowState(); this.miniEvent() } }, playVideo (index = 0, time = 0) { this.isLive = false @@ -908,7 +909,7 @@ export default { document.querySelector('xg-btn-quitMiniMode').style.display = 'block' this.miniMode = true }, - async exitMiniEvent () { + async saveMiniWindowState () { await mini.find().then(res => { let doc = {} doc = { @@ -921,6 +922,9 @@ export default { mini.add(doc) } }) + }, + async exitMiniEvent () { + await this.saveMiniWindowState() win.setBounds(this.mainWindowBounds) this.xg.exitCssFullscreen() document.querySelector('xg-btn-quitMiniMode').style.display = 'none' @@ -1496,8 +1500,8 @@ export default { this.toggleHistory() }) - this.xg.on('videoStop', () => { - if (this.miniMode) this.exitMiniEvent() + this.xg.on('videoStop', async () => { + if (this.miniMode) await this.exitMiniEvent() this.videoStop() }) @@ -1544,7 +1548,6 @@ export default { this.state.showChannelList = false } } - if (this.miniMode) this.miniEvent() }) }, videoStop () {