From 2c93d755c738818f8841bf0a146f0ccff0d75470 Mon Sep 17 00:00:00 2001 From: buvta <12312540+buvta@users.noreply.github.com> Date: Thu, 21 Jan 2021 18:12:23 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"=E4=BF=AE=E5=A4=8Dplay-request-was-in?= =?UTF-8?q?terrupted=E6=8A=A5=E9=94=99"=EF=BC=8C=E9=87=8D=E6=96=B0?= =?UTF-8?q?=E5=8F=91=E5=B8=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 088cd70e41fd96e3559e0a4691008167f6595f26. --- src/components/Play.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/Play.vue b/src/components/Play.vue index 522ca97..b4ddb88 100644 --- a/src/components/Play.vue +++ b/src/components/Play.vue @@ -534,6 +534,9 @@ export default { clearInterval(this.timer) this.timer = null } + if (this.xg && this.xg.hasStart) { + this.xg.pause() + } if (this.video.iptv) { // 是直播源,直接播放 @@ -595,6 +598,7 @@ export default { this.getPlayer(extRE[1]) if (extRE[1] === 'flv') this.xg.config.isLive = true this.xg.src = channel.url + this.xg.play() this.changingIPTV = false 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' @@ -602,7 +606,7 @@ export default { getPlayer (playerType, force = false) { if (!force && this.playerType === playerType) return if (this.playerType !== 'flv') { - this.xg.src = '' + this.xg.src = '' // https://developers.google.com/web/updates/2017/06/play-request-was-interrupted#danger-zone this.config.url = '' } try { @@ -653,6 +657,7 @@ export default { this.xg.src = url const key = this.video.key + '@' + this.video.info.id const startTime = VIDEO_DETAIL_CACHE[key].startPosition || 0 + this.xg.play() if (document.querySelector('xg-btn-showhistory')) document.querySelector('xg-btn-showhistory').style.display = 'block' if (document.querySelector('.xgplayer-playbackrate')) document.querySelector('.xgplayer-playbackrate').style.display = 'inline-block' this.xg.once('playing', () => {