mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2025-08-04 18:15:01 +02:00
Local media sync events
This commit is contained in:
parent
297eca6a86
commit
8f6dd72df2
15 changed files with 234 additions and 80 deletions
|
@ -43,7 +43,7 @@ class AbsAudioPlayerWeb extends WebPlugin {
|
|||
}
|
||||
|
||||
// PluginMethod
|
||||
async prepareLibraryItem({ libraryItemId, episodeId, playWhenReady }) {
|
||||
async prepareLibraryItem({ libraryItemId, episodeId, playWhenReady, startTime }) {
|
||||
console.log('[AbsAudioPlayer] Prepare library item', libraryItemId)
|
||||
|
||||
if (libraryItemId.startsWith('local_')) {
|
||||
|
@ -52,6 +52,7 @@ class AbsAudioPlayerWeb extends WebPlugin {
|
|||
var route = !episodeId ? `/api/items/${libraryItemId}/play` : `/api/items/${libraryItemId}/play/${episodeId}`
|
||||
var playbackSession = await $axios.$post(route, { mediaPlayer: 'html5-mobile', forceDirectPlay: true })
|
||||
if (playbackSession) {
|
||||
if (startTime !== undefined && startTime !== null) playbackSession.currentTime = startTime
|
||||
this.setAudioPlayer(playbackSession, true)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -62,6 +62,10 @@ class DbService {
|
|||
return AbsDatabase.getAllLocalMediaProgress().then((data) => data.value)
|
||||
}
|
||||
|
||||
getLocalMediaProgressForServerItem(payload) {
|
||||
return AbsDatabase.getLocalMediaProgressForServerItem(payload)
|
||||
}
|
||||
|
||||
removeLocalMediaProgress(localMediaProgressId) {
|
||||
return AbsDatabase.removeLocalMediaProgress({ localMediaProgressId })
|
||||
}
|
||||
|
|
|
@ -104,7 +104,7 @@ Vue.prototype.$secondsToTimestamp = (seconds) => {
|
|||
}
|
||||
|
||||
Vue.prototype.$secondsToTimestampFull = (seconds) => {
|
||||
let _seconds = seconds
|
||||
let _seconds = Math.round(seconds)
|
||||
let _minutes = Math.floor(seconds / 60)
|
||||
_seconds -= _minutes * 60
|
||||
let _hours = Math.floor(_minutes / 60)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue