Skip to content

Add a method to access the RemoteMediaClient in PillarboxCastPlayer#956

Merged
StaehliJ merged 2 commits into928-custom-castplayerfrom
RemoteMediaClient_nullability
Mar 27, 2025
Merged

Add a method to access the RemoteMediaClient in PillarboxCastPlayer#956
StaehliJ merged 2 commits into928-custom-castplayerfrom
RemoteMediaClient_nullability

Conversation

@MGaetan89
Copy link
Contributor

Pull request

Description

This PR simplifies the usage of RemoteMediaClient in PillarboxCastPlayer by providing a withRemoteClient method that takes care of ensuring that the RemoteMediaClient is not null, optionally invalidating the state, and returning a Futures.immediateVoidFuture().

Example:

fun handleSomeCommand(): ListenableFuture<*> = withRemoteClient { // this: RemoteMediaClient
    queueShuffle(null)
}

Changes made

  • Add a withRemoteClient() method to PillarboxCastPlayer.
  • Update PillarboxCastOptionProvider to use constants for the different receiver ids.

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).

@MGaetan89 MGaetan89 added this to the Cast milestone Mar 24, 2025
@MGaetan89 MGaetan89 requested a review from StaehliJ March 24, 2025 15:22
@MGaetan89 MGaetan89 self-assigned this Mar 24, 2025
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Pillarbox Mar 24, 2025
@MGaetan89 MGaetan89 force-pushed the RemoteMediaClient_nullability branch from a0eb242 to 98c341c Compare March 24, 2025 15:24
@MGaetan89 MGaetan89 moved this from 📋 Backlog to 🚧 In Progress in Pillarbox Mar 24, 2025
@MGaetan89 MGaetan89 force-pushed the RemoteMediaClient_nullability branch from a298993 to 98c341c Compare March 24, 2025 15:39
@MGaetan89 MGaetan89 moved this from 🚧 In Progress to 🍿 Code Review in Pillarbox Mar 24, 2025
@MGaetan89 MGaetan89 force-pushed the RemoteMediaClient_nullability branch from 98c341c to ea91e27 Compare March 26, 2025 08:11
@github-actions
Copy link

github-actions bot commented Mar 26, 2025

Code Coverage

Overall Project 49.99% -1.11% 🟢
Files changed 0% 🟢

Module Coverage
:pillarbox-cast 8.16% -22.74% 🟢
Files
Module File Coverage
:pillarbox-cast PillarboxCastPlayer.kt 3.93% -33.91% 🟢

Call invalideState if needed inside the command
@StaehliJ StaehliJ merged commit 5b292a7 into 928-custom-castplayer Mar 27, 2025
9 of 10 checks passed
@StaehliJ StaehliJ deleted the RemoteMediaClient_nullability branch March 27, 2025 13:17
@github-project-automation github-project-automation bot moved this from 🍿 Code Review to ✅ Done in Pillarbox Mar 27, 2025
StaehliJ added a commit that referenced this pull request Apr 2, 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.

2 participants