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', () => {