Skip to content

Add device volume management to PillarboxCastPlayer#1012

Merged
StaehliJ merged 3 commits into928-custom-castplayerfrom
1003-import-cast-volume-management-from-media3
May 27, 2025
Merged

Add device volume management to PillarboxCastPlayer#1012
StaehliJ merged 3 commits into928-custom-castplayerfrom
1003-import-cast-volume-management-from-media3

Conversation

@MGaetan89
Copy link
Contributor

@MGaetan89 MGaetan89 commented May 2, 2025

Description

This PR implements the following method in PillarboxCastPlayer:

  • handleSetDeviceVolume().
  • handleIncreaseDeviceVolume().
  • handleDecreaseDeviceVolume().
  • handleSetDeviceMuted().

These implementations are based on AndroidX Media3's implementations from androidx/media@405365c.

Changes made

  • Use the CastSession to handle to device volume instead of the RemoteMediaClient.
  • Implement device-related volume management methods.
  • Move the MediaRouteSelector to the ViewModel and use the one provided by Cast if available.

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 self-assigned this May 2, 2025
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Pillarbox May 2, 2025
private val DEVICE_INFO_REMOTE_EMPTY = DeviceInfo.Builder(DeviceInfo.PLAYBACK_TYPE_REMOTE).build()

/**
* @see androidx.media3.cast.CastPlayer.MAX_VOLUME
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@github-actions
Copy link

github-actions bot commented May 2, 2025

Code Coverage

Overall Project 49.17% -0.58% 🟢
Files changed 13.16% 🟢

Module Coverage
:pillarbox-player 57.61% 🟢
:pillarbox-cast 18.81% -6.29% 🟢
Files
Module File Coverage
:pillarbox-player StringUtil.kt 100% 🟢
:pillarbox-cast RemoteMediaClient.kt 87.42% 🟢
PillarboxCastPlayer.kt 1.14% -10.72% 🟢

@MGaetan89 MGaetan89 linked an issue May 2, 2025 that may be closed by this pull request
@MGaetan89 MGaetan89 force-pushed the 1003-import-cast-volume-management-from-media3 branch 2 times, most recently from 6e8da3f to 87d5d90 Compare May 7, 2025 07:04
@MGaetan89 MGaetan89 force-pushed the 1003-import-cast-volume-management-from-media3 branch 3 times, most recently from a7592b9 to 547570a Compare May 26, 2025 09:28
MGaetan89 added 3 commits May 27, 2025 09:39
…eVolume`, `handleDecreaseDeviceVolume` and `handleSetDeviceMuted` to PillarboxCastPlayer

These implementations are based on AndroidX Media3's implementations from androidx/media@405365c
@MGaetan89 MGaetan89 force-pushed the 1003-import-cast-volume-management-from-media3 branch from 1444ca3 to cb2ab57 Compare May 27, 2025 07:40
@MGaetan89 MGaetan89 marked this pull request as ready for review May 27, 2025 11:12
@MGaetan89 MGaetan89 requested a review from StaehliJ May 27, 2025 11:13
@StaehliJ StaehliJ merged commit dab9507 into 928-custom-castplayer May 27, 2025
10 checks passed
@StaehliJ StaehliJ deleted the 1003-import-cast-volume-management-from-media3 branch May 27, 2025 13:08
@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in Pillarbox May 27, 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.

Import Cast volume management from Media3

2 participants