保存音量

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()

View File

@@ -6,7 +6,7 @@ const db = new Dexie('zy')
db.version(4).stores({
search: '++id, keywords',
iptvSearch: '++id, keywords',
setting: 'id, theme, site, shortcut, view, externalPlayer, searchGroup, excludeRootClasses, excludeR18Films, forwardTimeInSec, starViewMode, recommandationViewMode, searchViewMode, password, proxy',
setting: 'id, theme, site, shortcut, view, volume, externalPlayer, searchGroup, excludeRootClasses, excludeR18Films, forwardTimeInSec, starViewMode, recommandationViewMode, searchViewMode, password, proxy',
shortcut: 'name, key, desc',
star: '++id, [key+ids], site, name, detail, index, rate, hasUpdate',
recommendation: '++id, [key+ids], site, name, detail, index, rate, hasUpdate',