mirror of
https://github.com/cuiocean/ZY-Player.git
synced 2026-05-05 19:31:21 +08:00
直播卡顿时自动换源
This commit is contained in:
@@ -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()
|
||||
})
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -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', () => {
|
||||
|
||||
@@ -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
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user