-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add new custom action #530
base: compose
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay! I've requested some fixes.
common/src/main/java/com/example/android/uamp/media/MusicService.kt
Outdated
Show resolved
Hide resolved
common/src/main/java/com/example/android/uamp/media/MusicService.kt
Outdated
Show resolved
Hide resolved
common/src/main/java/com/example/android/uamp/media/MusicService.kt
Outdated
Show resolved
Hide resolved
common/src/main/java/com/example/android/uamp/media/MusicService.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! Looking much better - I think you're adding the commands in correctly now. Just one last comment about the functionality of each command.
@@ -470,6 +495,16 @@ open class MusicService : MediaLibraryService() { | |||
|
|||
return Futures.immediateFuture(SessionResult(SessionResult.RESULT_SUCCESS)) | |||
} | |||
|
|||
if (customCommand.customAction == SEEK_BACK) { | |||
exoPlayer.seekBack() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These commands are replicating functionality that's already handled by standard commands defined by a Player
, which we don't want to encourage (see the note at the end of this section) - could you update these commands to do something different? Here are some ideas:
- Jump to a random item in the current playlist (see one of my previous comments for some pointers on how to execute on this)
- Copy the current song title to the clipboard (https://developer.android.com/develop/ui/views/touch-and-input/copy-paste#Copying)
- Add the current song to some sort of "favorites" list (You could do similar logic to what we have here, but with
FAVORITE_SONG_*_KEY
)
This pull request aims to enhance the compatibility and functionality of the uamp application by enabling the transmission of custom actions from the main app to connected client apps.