diff --git a/src/components/Play.vue b/src/components/Play.vue index 23104fe..e95b037 100644 --- a/src/components/Play.vue +++ b/src/components/Play.vue @@ -1420,18 +1420,27 @@ export default { }) }, bindEvent () { + // 直播卡顿时换源换台 let stallIptvTimeout + let stallCount = 0 this.xg.on('waiting', () => { - if (this.isLive && this.setting.autoChangeSourceWhenIptvStalling && this.right.sources.length > 1) { + if (this.isLive && this.setting.autoChangeSourceWhenIptvStalling) { stallIptvTimeout = setTimeout(() => { let index = this.right.sources.indexOf(this.video.iptv) + 1 if (index === this.right.sources.length) index = 0 + stallCount++ clearTimeout(stallIptvTimeout) - this.playChannel(this.right.sources[index]) + if (stallCount >= this.right.sources.length) { + stallCount = 0 + this.nextEvent() + } else { + this.playChannel(this.right.sources[index]) + } }, this.setting.waitingTimeInSec * 1000) } }) this.xg.on('canplay', () => { + stallCount = 0 if (stallIptvTimeout) clearTimeout(stallIptvTimeout) }) diff --git a/src/components/Setting.vue b/src/components/Setting.vue index 382aac7..c9e968c 100644 --- a/src/components/Setting.vue +++ b/src/components/Setting.vue @@ -77,7 +77,7 @@
- 卡顿时自动换源:秒 + 卡顿时自动换源换台: