mirror of
https://github.com/cuiocean/ZY-Player.git
synced 2026-05-05 15:12:13 +08:00
频道所有源全部卡顿时自动换台
This commit is contained in:
@@ -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)
|
||||
})
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
</div>
|
||||
<div class="zy-input">
|
||||
<input type="checkbox" v-model = "d.autoChangeSourceWhenIptvStalling" @change="updateSettingEvent">
|
||||
卡顿时自动换源:<input style="width:50px" type="number" min=0 v-model.number = "d.waitingTimeInSec" @change="updateSettingEvent">秒
|
||||
卡顿时自动换源换台:<input style="width:50px" type="number" min=0 v-model.number = "d.waitingTimeInSec" @change="updateSettingEvent">秒
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user