This PR adds additional media controls to Android Auto (and perhaps Wear and maybe Automotive?) I know little about how Android's MediaBrowserService works and Google's lack of documentation seems motivated to keep things a mystery.
So far, this change includes:
Addition of jump forward button in Android Auto.
Addition of jump back button in Android Auto.
Player, Android notification, and Android Auto all respect the "Jump" times specified in device settings.
Discussion Points:
Previous button - This button appears on Android Auto and I have no idea how to remove it, so I mapped it's functionality to the media player's previous functionality.
Next button - Since it seems we have no control over which standard buttons are shown, I experimented with adding a next button as a custom action. This is doable but we'll have to start managing our own prev/next drawables if we want a guarantee of consistent UI.
Order of custom action buttons on the UI is weird. Some buttons are added before play/pause and some after. I didn't find anything that gives us control of the weight.
String - A lot of UI strings are defined in the capacitorjs code. Rather than add to strings.xml, we should be pulling from the JS if we can but I'm not sure how.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
## 📋 Pull Request Information
**Original PR:** https://github.com/advplyr/audiobookshelf-app/pull/328
**Author:** [@vangorra](https://github.com/vangorra)
**Created:** 8/21/2022
**Status:** ✅ Merged
**Merged:** 8/21/2022
**Merged by:** [@advplyr](https://github.com/advplyr)
**Base:** `master` ← **Head:** `vangorra/android_auto_buttons`
---
### 📝 Commits (1)
- [`621a493`](https://github.com/advplyr/audiobookshelf-app/commit/621a493c5b3d30e9e5468b723d346eea7f7e2891) Add jump back and jump forward buttons to android auto.
### 📊 Changes
**6 files changed** (+88 additions, -40 deletions)
<details>
<summary>View changed files</summary>
📝 `android/app/src/main/java/com/audiobookshelf/app/data/DeviceClasses.kt` (+2 -2)
📝 `android/app/src/main/java/com/audiobookshelf/app/player/MediaSessionCallback.kt` (+16 -19)
➕ `android/app/src/main/java/com/audiobookshelf/app/player/PlayerConstants.kt` (+4 -0)
📝 `android/app/src/main/java/com/audiobookshelf/app/player/PlayerNotificationService.kt` (+62 -17)
📝 `android/app/src/main/res/values/strings.xml` (+2 -0)
📝 `android/build.gradle` (+2 -2)
</details>
### 📄 Description
This PR adds additional media controls to Android Auto (and perhaps Wear and maybe Automotive?) I know little about how Android's MediaBrowserService works and Google's lack of documentation seems motivated to keep things a mystery.
So far, this change includes:
- Addition of jump forward button in Android Auto.
- Addition of jump back button in Android Auto.
- Player, Android notification, and Android Auto all respect the "Jump" times specified in device settings.
Discussion Points:
- Previous button - This button appears on Android Auto and I have no idea how to remove it, so I mapped it's functionality to the media player's previous functionality.
- Next button - Since it seems we have no control over which standard buttons are shown, I experimented with adding a next button as a custom action. This is doable but we'll have to start managing our own prev/next drawables if we want a guarantee of consistent UI.
- Order of custom action buttons on the UI is weird. Some buttons are added before play/pause and some after. I didn't find anything that gives us control of the weight.
- String - A lot of UI strings are defined in the capacitorjs code. Rather than add to strings.xml, we should be pulling from the JS if we can but I'm not sure how.

Ref: #79
---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/advplyr/audiobookshelf-app/pull/328
Author: @vangorra
Created: 8/21/2022
Status: ✅ Merged
Merged: 8/21/2022
Merged by: @advplyr
Base:
master← Head:vangorra/android_auto_buttons📝 Commits (1)
621a493Add jump back and jump forward buttons to android auto.📊 Changes
6 files changed (+88 additions, -40 deletions)
View changed files
📝
android/app/src/main/java/com/audiobookshelf/app/data/DeviceClasses.kt(+2 -2)📝
android/app/src/main/java/com/audiobookshelf/app/player/MediaSessionCallback.kt(+16 -19)➕
android/app/src/main/java/com/audiobookshelf/app/player/PlayerConstants.kt(+4 -0)📝
android/app/src/main/java/com/audiobookshelf/app/player/PlayerNotificationService.kt(+62 -17)📝
android/app/src/main/res/values/strings.xml(+2 -0)📝
android/build.gradle(+2 -2)📄 Description
This PR adds additional media controls to Android Auto (and perhaps Wear and maybe Automotive?) I know little about how Android's MediaBrowserService works and Google's lack of documentation seems motivated to keep things a mystery.
So far, this change includes:
Discussion Points:
Ref: #79
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.