Skip to content
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

How to force MediaSession to always keep skipping enabled? #1250

Closed
OxygenCobalt opened this issue Apr 8, 2024 · 1 comment
Closed

How to force MediaSession to always keep skipping enabled? #1250

OxygenCobalt opened this issue Apr 8, 2024 · 1 comment
Assignees
Labels

Comments

@OxygenCobalt
Copy link
Contributor

My app's current playback behavior makes skipping always available, just with special handling of the wraparound cases. However, even when I indicate this within my own player instance:

class MyPlayer(
    val player: ExoPlayer,
) : ForwardingPlayer(player) {
    // ...
    override fun isCommandAvailable(command: Int): Boolean {
        // We can always skip forward and backward (this is to retain parity with the old behavior)
        return super.isCommandAvailable(command) ||
            command == COMMAND_SEEK_TO_NEXT || command == COMMAND_SEEK_TO_PREVIOUS
    }
    // ...
}

The MediaSession still doesn't always enable skipping, with the notification still having it's skip next/previous buttons removed when at the ends of a playlist. What exactly am I doing wrong here?

@marcbaechinger
Copy link
Contributor

This is a duplicate of #1183 . Please add you comment there if you have some further questions.

@androidx androidx locked and limited conversation to collaborators Jun 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants