保存音量

This commit is contained in:
buvta
2020-11-20 22:08:38 +08:00
parent 31510624c1
commit 641bdf00d3
2 changed files with 9 additions and 2 deletions

View File

@@ -1246,6 +1246,11 @@ export default {
if (this.miniMode) this.xg.getCssFullscreen()
})
this.xg.on('volumechange', () => {
this.config.volume = this.xg.volume.toFixed(2)
setting.find().then(res => { res.volume = this.config.volume; setting.update(res) })
})
this.xg.on('playNextOne', () => {
this.nextEvent()
})
@@ -1363,8 +1368,10 @@ export default {
this.getAllhistory()
this.mtEvent()
},
mounted () {
async mounted () {
const db = await setting.find()
this.playerInstall()
this.config.volume = db.volume
this.xg = new HlsJsPlayer(this.config)
this.bindEvent()
this.minMaxEvent()