Skip to content

Take the repeat mode into consideration when defining the available commands#1059

Merged
MGaetan89 merged 1 commit into928-custom-castplayerfrom
1021-check-seek-to-nextprevious-commands-state-when-repeat-mode-is-enabled
Jun 10, 2025
Merged

Take the repeat mode into consideration when defining the available commands#1059
MGaetan89 merged 1 commit into928-custom-castplayerfrom
1021-check-seek-to-nextprevious-commands-state-when-repeat-mode-is-enabled

Conversation

@MGaetan89
Copy link
Contributor

@MGaetan89 MGaetan89 commented Jun 5, 2025

Pull request

Description

This PR updates the implementation of RemoteMediaClient.getAvailableCommands() to take the repeat mode into consideration when defining if the COMMAND_SEEK_TO_PREVIOUS and COMMAND_SEEK_TO_NEXT commands are available.

The implementation is based on: https://github.com/androidx/media/blob/ae9a2339679826f870690092509a135dffc0d7e4/libraries/common/src/main/java/androidx/media3/common/util/Util.java#L3557-L3585

Changes made

  • Update RemoteMediaClient.getAvailableCommands() to use the repeat mode to define available commands.
  • Improve animation in PlayerBottomToolbar when buttons become (un)available.
  • Inline RemoteMediaClient.getMediaIdFromIndex(), since it holds little logic.
  • Add new tests.

Checklist

  • APIs have been properly documented (if relevant).
  • The documentation has been updated (if relevant).
  • New unit tests have been written (if relevant).
  • The demo has been updated (if relevant).

@github-project-automation github-project-automation bot moved this to 📋 Backlog in Pillarbox Jun 5, 2025
@MGaetan89 MGaetan89 marked this pull request as ready for review June 5, 2025 08:28
@MGaetan89 MGaetan89 force-pushed the 1021-check-seek-to-nextprevious-commands-state-when-repeat-mode-is-enabled branch from bcef676 to 88d8ce5 Compare June 10, 2025 09:34
@github-actions
Copy link

Code Coverage

Overall Project 47.36% -0.13% 🟢
Files changed 74.19% 🟢

Module Coverage
:pillarbox-cast 20.45% -1.44% 🟢
Files
Module File Coverage
:pillarbox-cast RemoteMediaClient.kt 91.43% -3.67% 🟢
PillarboxCastPlayer.kt 1.1% -1.41% 🟢

@MGaetan89 MGaetan89 merged commit 9f8a091 into 928-custom-castplayer Jun 10, 2025
10 checks passed
@MGaetan89 MGaetan89 deleted the 1021-check-seek-to-nextprevious-commands-state-when-repeat-mode-is-enabled branch June 10, 2025 15:19
@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in Pillarbox Jun 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

Check seek to next/previous commands state when repeat mode is enabled

2 participants