直播卡顿时自动换源

This commit is contained in:
buvta
2021-01-20 23:02:06 +08:00
parent 9fd3e5e2ed
commit 334933ce82
4 changed files with 26 additions and 1 deletions

View File

@@ -1420,6 +1420,21 @@ export default {
})
},
bindEvent () {
let stallIptvTimeout
this.xg.on('waiting', () => {
if (this.isLive && this.setting.autoChangeSourceWhenIptvStalling && this.right.sources.length > 1) {
stallIptvTimeout = setTimeout(() => {
let index = this.right.sources.indexOf(this.video.iptv) + 1
if (index === this.right.sources.length) index = 0
clearTimeout(stallIptvTimeout)
this.playChannel(this.right.sources[index])
}, this.setting.waitingTimeInSec * 1000)
}
})
this.xg.on('canplay', () => {
if (stallIptvTimeout) clearTimeout(stallIptvTimeout)
})
this.xg.on('exitFullscreen', () => {
if (this.miniMode) this.xg.getCssFullscreen()
})

View File

@@ -75,6 +75,10 @@
<div class="zy-input">
<input type="checkbox" v-model = "d.autocleanWhenIptvCheck" @change="updateSettingEvent"> 检测时自动清理无效源
</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">
</div>
</div>
</div>
<div class="site">

View File

@@ -53,6 +53,10 @@ db.version(8).stores({
trans.sites.toCollection().modify(site => {
if (site.api.includes('7kjx.com')) site.jiexiUrl = 'default'
})
trans.setting.toCollection().modify(setting => {
setting.waitingTimeInSec = 15
setting.autoChangeSourceWhenIptvStalling = true
})
})
db.on('populate', () => {

View File

@@ -9,6 +9,7 @@ const setting = [
excludeRootClasses: true,
excludeR18Films: true,
forwardTimeInSec: 5,
waitingTimeInSec: 15,
starViewMode: 'picture',
recommendationViewMode: 'picture',
historyViewMode: 'picture',
@@ -21,7 +22,8 @@ const setting = [
port: ''
},
allowPassWhenIptvCheck: true,
autocleanWhenIptvCheck: false
autocleanWhenIptvCheck: false,
autoChangeSourceWhenIptvStalling: true
}
]