From 9b5b5a1334ee60ad28f447df29b179340f874b50 Mon Sep 17 00:00:00 2001 From: buvta <12312540+buvta@users.noreply.github.com> Date: Sun, 13 Dec 2020 12:38:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=92=AD=E6=94=BE=E5=99=A8?= =?UTF-8?q?=E5=88=9D=E5=A7=8B=E7=8A=B6=E6=80=81=E6=97=B6=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E6=92=AD=E6=94=BE=E6=97=B6=E7=9A=84bug=EF=BC=8C=E5=B9=B6?= =?UTF-8?q?=E7=BB=99=E7=9B=B4=E6=92=AD=E5=8A=A0=E4=B8=8A=E5=AF=B9=E5=BA=94?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Play.vue | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/components/Play.vue b/src/components/Play.vue index efd2912..f959d10 100644 --- a/src/components/Play.vue +++ b/src/components/Play.vue @@ -346,6 +346,7 @@ export default { channelList: [], channelListForShow: [], channelListShow: false, + isLive: false, defaultProps: { label: 'label', children: 'children' @@ -541,6 +542,7 @@ export default { channelList.add(ele) }, playChannel (channel) { + this.isLive = true if (channel.channels) { this.right.sources = channel.channels.filter(e => e.isActive) channel = channel.prefer ? channel.channels.find(e => e.id === channel.prefer) : channel.channels.filter(e => e.isActive)[0] @@ -559,6 +561,7 @@ export default { document.querySelector('.xgplayer-playbackrate').style.display = 'none' }, playVideo (index = 0, time = 0) { + this.isLive = false document.querySelector('xg-btn-showhistory').style.display = 'block' document.querySelector('.xgplayer-playbackrate').style.display = 'inline-block' this.fetchM3u8List().then(m3u8Arr => { @@ -1399,11 +1402,15 @@ export default { }) this.xg.on('play', () => { - if (!this.video.key && !this.video.info.ids) { - // 如果当前播放页面的播放信息没有被赋值,播放历史记录 - var historyItem = this.right.history[0] - this.video = { key: historyItem.site, info: { id: historyItem.ids, name: historyItem.name, index: historyItem.index } } - this.getUrls() + if (!this.video.key) { + if (!this.video.iptv && !this.video.info.ids) { + // 如果当前播放页面的播放信息没有被赋值,播放历史记录 + var historyItem = this.right.history[0] + this.video = { key: historyItem.site, info: { id: historyItem.ids, name: historyItem.name, index: historyItem.index } } + this.getUrls() + } else if (this.video.iptv && !this.isLive) { + this.playChannel(this.video.iptv) + } } }) }, @@ -1419,6 +1426,7 @@ export default { this.xg.destroy(false) this.xg = null this.name = '' + this.isLive = false this.right.list = [] this.getAllhistory() setTimeout(() => {