Tyzer34 / plexMusicPlayer

Playback music with Alexa from your Plex Server!
https://medium.com/@Tyzer34/plex-alexa-the-perfect-wedding-38b14b41faf0#.b71cd6lsn
GNU General Public License v3.0
35 stars 19 forks source link

Pause and resume #14

Open jim-moore-sp opened 7 years ago

jim-moore-sp commented 7 years ago

Thoughts on supporting pause and resume of tracks across listening sessions? I'd love to be able to use this to play audiobooks and resume where I left off in the previous listening session.

Tyzer34 commented 7 years ago

This should normally be possible, as we can save the offset of an audio track (thus the place where you stopped) and normally resume at that point again (when you want to restart). It would be the easiest to just save a single audio file and resume where it left off, but that wouldn't be really dynamic as you would only be able to save a single audiobook's progress. I think the following scenarios should be applicable:

SAVING PROGRESS

*Audiobook is Playing*
Req: "Alexa, ask plexmusic to save my progress."
--> Application stores track-id + offset
Resp: "Your progress for *trackname* has been saved."

RESTORING PROGRESS

Req: "Alexa, ask plexmusic to play *trackname*"
--> Application checks if progress is saved, if so, play from saved offset
Resp: "Resuming *trackname*."
*Audiobook resumes Playing*

Another thing that should be accounted for, would be the Resume intent (where the offset should be reset, aka, saved progress deleted)

So all by all, I enact this as certainly possible! Do you agree with the proposed scenarios? I'll have more time in a few weeks to further work on this project, so I'll be sure to implement this feature then!

jim-moore-sp commented 7 years ago

Thanks for following up!

Thinking through this a little more I think it may be a bit more complex. An audiobook is really more of a playlist than a single track -- a book is often divided into 12 or more files, with the break often coming in the middle of chapters, etc (i.e. based on file size rather than some logical divider in the book).

You probably want to trigger it by saying something like "Alexa, ask plexmusic to read 1984 by George Orwell", not "Alexa, ask plexmusic to play 1984 - Track 7 by George Orwell." Following from this, I think you'd need to save not only the stopping point in the current file, but also the playlist somehow so that Alexa will flow seamlessly from one track to the next when reading.

On Tue, Jan 24, 2017 at 2:32 AM, Bjorn Vuylsteker notifications@github.com wrote:

This should normally be possible, as we can save the offset of an audio track (thus the place where you stopped) and normally resume at that point again (when you want to restart). It would be the easiest to just save a single audio file and resume where it left off, but that wouldn't be really dynamic as you would only be able to save a single audiobook's progress. I think the following scenarios should be applicable:

SAVING PROGRESS

Audiobook is Playing Req: "Alexa, ask plexmusic to save my progress." --> Application stores track-id + offset Resp: "Your progress for trackname has been saved."

RESTORING PROGRESS

Req: "Alexa, ask plexmusic to play trackname" --> Application checks if progress is saved, if so, play from saved offset Resp: "Resuming trackname." Audiobook resumes Playing

Another thing that should be accounted for, would be the Resume intent (where the offset should be reset, aka, saved progress deleted)

So all by all, I enact this as certainly possible! Do you agree with the proposed scenarios? I'll have more time in a few weeks to further work on this project, so I'll be sure to implement this feature then!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Tyzer34/plexMusicPlayer/issues/14#issuecomment-274740246, or mute the thread https://github.com/notifications/unsubscribe-auth/ANIPliMFxjy7jKAjoQarGIg_dhyn3vJhks5rVbc4gaJpZM4LrVPo .

-- Jim Moore Vice President, Engineering, IdentityNow and Identity Analytics

mobile 949.542.9497 jim.moore@sailpoint.com

Tyzer34 commented 7 years ago

Ah okay, this indeed makes it a little bit more complex. This could still be implemented as a feature, however, it is not that easy as Plex itself does not make a distinction between a song and an audio book. What could be done is, if you would set your audiobook as a playlist for example, save the progress of the playlist, which would lead back to the different methods I explained beforehand. This way, "Alexa, ask plexmusic to read 1984 by George Orwell" should look for a playlist in your Plex library called "1984 by George Orwell" (or whatever you want to call it), which will initialize the playback based on where you last left off.