Easy way to play current audiobook

This patch implements a generic way of re-opening the player for the
book you last listened to. This is especially handy when first opening
the app and you can restart playback with a single click.

The player is opened only if no other book is already open in the
player. It will not overwrite or replace playbacks or player already in
progress.

The player is opened paused. No automatic playback since that could be
really annoying.

This closes #494
This commit is contained in:
Lars Kiesow
2023-02-11 23:14:41 +01:00
parent 5e0c740f02
commit ec704bf501
2 changed files with 11 additions and 1 deletions
+2 -1
View File
@@ -188,6 +188,7 @@ export default {
const libraryItemId = payload.libraryItemId
const episodeId = payload.episodeId
const startTime = payload.startTime
const startWhenReady = !payload.paused
// When playing local library item and can also play this item from the server
// then store the server library item id so it can be used if a cast is made
@@ -223,7 +224,7 @@ export default {
}
console.log('Called playLibraryItem', libraryItemId)
const preparePayload = { libraryItemId, episodeId, playWhenReady: true, playbackRate }
const preparePayload = { libraryItemId, episodeId, playWhenReady: startWhenReady, playbackRate }
if (startTime !== undefined && startTime !== null) preparePayload.startTime = startTime
AbsAudioPlayer.prepareLibraryItem(preparePayload)
.then((data) => {