mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2025-08-31 07:09:53 +02:00
feat: now playing chapter track
This commit is contained in:
parent
793f0c05f7
commit
2b1667e532
11 changed files with 91 additions and 11 deletions
|
@ -141,6 +141,11 @@ class AbsAudioPlayerWeb extends WebPlugin {
|
|||
if (this.player) this.player.playbackRate = value
|
||||
}
|
||||
|
||||
// PluginMethod
|
||||
setChapterTrack({ enabled }) {
|
||||
this.useChapterTrack = enabled
|
||||
}
|
||||
|
||||
// PluginMethod
|
||||
async getCurrentTime() {
|
||||
return {
|
||||
|
@ -262,4 +267,4 @@ export { AbsAudioPlayer }
|
|||
export default ({ app, store }, inject) => {
|
||||
$axios = app.$axios
|
||||
vuexStore = store
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
import { Preferences } from '@capacitor/preferences'
|
||||
import { AbsAudioPlayer } from '@/plugins/capacitor'
|
||||
|
||||
|
||||
class LocalStorage {
|
||||
constructor(vuexStore) {
|
||||
|
@ -45,6 +47,9 @@ class LocalStorage {
|
|||
async setUseChapterTrack(useChapterTrack) {
|
||||
try {
|
||||
await Preferences.set({ key: 'useChapterTrack', value: useChapterTrack ? '1' : '0' })
|
||||
console.log("ooooooo")
|
||||
console.log(useChapterTrack)
|
||||
AbsAudioPlayer.setChapterTrack({ enabled: useChapterTrack })
|
||||
} catch (error) {
|
||||
console.error('[LocalStorage] Failed to set use chapter track', error)
|
||||
}
|
||||
|
@ -184,4 +189,4 @@ class LocalStorage {
|
|||
|
||||
export default ({ app, store }, inject) => {
|
||||
inject('localStore', new LocalStorage(store))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue