audiobookshelf-app icon indicating copy to clipboard operation
audiobookshelf-app copied to clipboard

Basic Google Assistant App Action support

Open mr-ransel opened this issue 1 year ago • 1 comments

Is your feature request related to a problem?

I'm often using my phone via Google Assistant because my hands are busy and it would be really handy to be able to start new audiobooks or my most recent audiobook hands-free without having to grab the phone and set it up.

Describe the solution you'd like

My end goal would be to be able to ask Google Assistant on Android to play my last audiobook on audio bookshelf or to request a specific audiobook on audiobookshelf. In other words, a basic hands-free option for starting books.

Describe alternatives you've considered

The native Google Assistant functionality using audio bookshelf as a media player already works. You can say play, pause, skip forward and skip back and all of those functions work fine. If you've already started the book recently and they're still an active media session, you can just say play or pause and then the book will get started, but only if the book has recently been listened to.

Additional context

Implementing this is actually pretty easy. All you need to do is set up a new ntent and then an entry point with some code for selecting the audiobook from the library and beginning playback. Here's a link to the Google assistant documentation and tutorial on creating a new app action intent and how to trigger operations directly from Google Assistant. https://codelabs.developers.google.com/codelabs/appactions#1

Specifically, I think what would be helpful is an intent for play most recent and an intent for play arbitrary book or podcast.

We could probably just use this built in intent template to launch the app to a specific/most recent audiobook https://developer.android.com/reference/app-actions/built-in-intents/common/open-app-feature

mr-ransel avatar Nov 29 '23 04:11 mr-ransel

Related to https://github.com/advplyr/audiobookshelf-app/issues/858 and https://github.com/advplyr/audiobookshelf-app/issues/237 but has some examples with documentation

nichwall avatar Nov 29 '23 05:11 nichwall