Conversation
Generated by 🚫 Danger |
There was a problem hiding this comment.
Pull request overview
Adds Media3 migration support in the playback layer by introducing lightweight Player implementations/adapters and extracting shared MediaSession action logic, with Robolectric/unit tests validating behavior.
Changes:
- Introduce
PocketCastsForwardingPlayerto expose episode metadata + command overrides to Media3Player. - Add
CastStatePlayerto mirror cast playback state into Media3’s player model. - Extract shared MediaSession callback actions into
MediaSessionActionsand add tests for all new components.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| modules/services/repositories/src/main/java/au/com/shiftyjelly/pocketcasts/repositories/playback/PocketCastsForwardingPlayer.kt | New Media3 ForwardingPlayer wrapper exposing Pocket Casts metadata/commands and supporting player swapping. |
| modules/services/repositories/src/main/java/au/com/shiftyjelly/pocketcasts/repositories/playback/CastStatePlayer.kt | New SimpleBasePlayer to represent cast playback state inside a Media3 session. |
| modules/services/repositories/src/main/java/au/com/shiftyjelly/pocketcasts/repositories/playback/MediaSessionActions.kt | New shared action helper for legacy + Media3 session callbacks (search/playback actions, analytics). |
| modules/services/repositories/src/test/java/au/com/shiftyjelly/pocketcasts/repositories/playback/PocketCastsForwardingPlayerTest.kt | Robolectric tests for metadata/commands/swapping behavior of PocketCastsForwardingPlayer. |
| modules/services/repositories/src/test/java/au/com/shiftyjelly/pocketcasts/repositories/playback/CastStatePlayerTest.kt | Robolectric tests validating state mirroring and command delegation for CastStatePlayer. |
| modules/services/repositories/src/test/java/au/com/shiftyjelly/pocketcasts/repositories/playback/MediaSessionActionsTest.kt | Coroutine/Robolectric tests validating MediaSession action behaviors (search, speed, archive/star, analytics). |
You can also share your feedback on Copilot code review. Take the survey.
358a86c to
1b9673a
Compare
f2c4c68 to
9e355b1
Compare
|
Version |
9e355b1 to
c4375a8
Compare
There was a problem hiding this comment.
Pull request overview
Adds standalone Media3 migration components in the repositories playback layer, introducing a forwarding Player that exposes Pocket Casts episode metadata via Media3, plus a shared action handler to reduce duplication between legacy MediaSessionCompat and the new Media3 session callback.
Changes:
- Introduce
PocketCastsForwardingPlayerto wrap a Media3Playerand expose episode/podcast metadata asMediaItem/MediaMetadata. - Extract shared media-session actions into
MediaSessionActions(play-from-search, speed cycling, archive/star/mark played). - Add
CastStatePlayerto mirror Pocket Casts cast playback state into Media3’sPlayerstate model, with unit tests for the new components.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| modules/services/repositories/src/main/java/au/com/shiftyjelly/pocketcasts/repositories/playback/PocketCastsForwardingPlayer.kt | New Media3 ForwardingPlayer wrapper that owns and publishes enriched MediaMetadata/MediaItem. |
| modules/services/repositories/src/main/java/au/com/shiftyjelly/pocketcasts/repositories/playback/MediaSessionActions.kt | New shared action implementation extracted from legacy session callback for Media3 migration. |
| modules/services/repositories/src/main/java/au/com/shiftyjelly/pocketcasts/repositories/playback/CastStatePlayer.kt | New SimpleBasePlayer implementation to surface cast playback state to Media3 session/notifications. |
| modules/services/repositories/src/test/java/au/com/shiftyjelly/pocketcasts/repositories/playback/PocketCastsForwardingPlayerTest.kt | Unit tests validating metadata exposure, command availability, and callback behavior for forwarding player. |
| modules/services/repositories/src/test/java/au/com/shiftyjelly/pocketcasts/repositories/playback/MediaSessionActionsTest.kt | Unit tests covering search playback behavior and key action methods. |
| modules/services/repositories/src/test/java/au/com/shiftyjelly/pocketcasts/repositories/playback/CastStatePlayerTest.kt | Unit tests for cast state mirroring and command delegation. |
|
@geekygecko i know we discussed that this is a long PR but most of the PR is tests. the key copmonents to review are |
c4375a8 to
9d63c2a
Compare
- Only set userRating for PodcastEpisode (UserEpisode doesn't support starring) - Use PLAY_WHEN_READY_CHANGE_REASON_REMOTE for cast state updates Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Simplify seekTo overloads (remove redundant if/else) - Prevent duplicate listeners in internal list - Treat blank artwork URLs as null
Description
2nd step of the media3 migration work.
Created key components that will play important roles in the next phases.
PocketCastForwardingPlayer: Wraps an ExoPlayer and enriches it with episode metadata so that a Media3 MediaSession can read the current media item directly from the player.MediaSessionActions: Shared action methods used by both the legacy MediaSessionCompat and the new Media3SessionCallback. Reduces duplication across the two callback implementations during the Media3 migration.Testing Instructions
Just review the code as these components are not yet wired up.
Checklist
./gradlew spotlessApplyto automatically apply formatting/linting)modules/services/localization/src/main/res/values/strings.xml