Skip to content

Add Media3 session foundation#5140

Merged
sztomek merged 1 commit intomainfrom
media3/01-foundation
Mar 31, 2026
Merged

Add Media3 session foundation#5140
sztomek merged 1 commit intomainfrom
media3/01-foundation

Conversation

@sztomek
Copy link
Copy Markdown
Contributor

@sztomek sztomek commented Mar 17, 2026

Description

This is the first step of the media3 session migration.
My plan is to raise incremental PRs, each building on the previous one.
Merge order should be respected: this will be merged last once every change is here and tested.

Testing Instructions

Just review the code.

Checklist

  • If this is a user-facing change, I have added an entry in CHANGELOG.md
  • Ensure the linter passes (./gradlew spotlessApply to automatically apply formatting/linting)
  • I have considered whether it makes sense to add tests for my changes
  • All strings that need to be localized are in modules/services/localization/src/main/res/values/strings.xml
  • Any jetpack compose components I added or changed are covered by compose previews
  • I have updated (or requested that someone edit) the spreadsheet to reflect any new or changed analytics.

@sztomek sztomek added this to the 8.10 milestone Mar 17, 2026
@sztomek sztomek requested a review from a team as a code owner March 17, 2026 19:45
@sztomek sztomek added [Type] Enhancement Improve an existing feature. [Area] Playback Episode playback issue labels Mar 17, 2026
@sztomek sztomek requested review from MiSikora and Copilot and removed request for a team March 17, 2026 19:45
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Lays groundwork for an incremental migration to Media3 MediaSession by introducing a feature flag, starting to decouple cast playback state from the legacy compat constants, and adding the Media3 session dependency.

Changes:

  • Added Feature.MEDIA3_SESSION remote-config/dev-toggle feature flag.
  • Replaced PlaybackStateCompat integer state usage in CastPlayer with an internal enum.
  • Added the androidx.media3:media3-session dependency to the repositories module (and version catalog).

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
modules/services/utils/src/main/java/au/com/shiftyjelly/pocketcasts/utils/featureflag/Feature.kt Adds a feature flag entry for gating the Media3 session migration.
modules/services/repositories/src/main/java/au/com/shiftyjelly/pocketcasts/repositories/playback/CastPlayer.kt Refactors cast playback state tracking away from PlaybackStateCompat constants.
modules/services/repositories/build.gradle.kts Adds Media3 session dependency to repositories’ exported deps.
gradle/libs.versions.toml Defines media3-session in the version catalog.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread modules/services/repositories/build.gradle.kts
@wpmobilebot
Copy link
Copy Markdown
Collaborator

wpmobilebot commented Mar 17, 2026

Project dependencies changes

list
+ New Dependencies
androidx.media3:media3-session:1.9.3

! Upgraded Dependencies
androidx.media:media:1.7.0, (changed from 1.6.0)
tree
 +--- androidx.mediarouter:mediarouter:1.8.1
-|    \--- androidx.media:media:1.4.1 -> 1.6.0
-|         +--- androidx.annotation:annotation:1.2.0 -> 1.9.1 (*)
-|         +--- androidx.collection:collection:1.1.0 -> 1.5.0 (*)
-|         \--- androidx.core:core:1.6.0 -> 1.18.0 (*)
+|    \--- androidx.media:media:1.4.1 -> 1.7.0
+|         +--- androidx.annotation:annotation:1.2.0 -> 1.9.1 (*)
+|         +--- androidx.collection:collection:1.1.0 -> 1.5.0 (*)
+|         +--- androidx.core:core:1.6.0 -> 1.18.0 (*)
+|         \--- androidx.core:core:1.9.0 -> 1.18.0 (*)
++--- androidx.media3:media3-extractor:1.9.3
+|    \--- androidx.media3:media3-decoder:1.9.3
+|         \--- androidx.media3:media3-common:1.9.3
+|              \--- androidx.media3:media3-session:1.9.3 (c)
 +--- com.google.android.gms:play-services-cast-framework:22.3.0
-|    \--- androidx.media:media:1.6.0 (*)
+|    \--- androidx.media:media:1.6.0 -> 1.7.0 (*)
 +--- project :modules:features:account
 |    \--- project :modules:features:search
 |         \--- project :modules:services:analytics
 |              \--- project :modules:services:model
 |                   \--- project :modules:services:utils
 |                        \--- androidx.car.app:app:1.7.0
-|                             \--- androidx.media:media:1.6.0 (*)
+|                             \--- androidx.media:media:1.6.0 -> 1.7.0 (*)
+|         \--- project :modules:services:repositories
+|              \--- androidx.media3:media3-session:1.9.3
+|                   +--- androidx.media3:media3-datasource:1.9.3 (*)
+|                   +--- androidx.collection:collection:1.2.0 -> 1.5.0 (*)
+|                   +--- androidx.media:media:1.7.0 (*)
+|                   +--- androidx.core:core:1.8.0 -> 1.18.0 (*)
+|                   \--- androidx.media3:media3-common:1.9.3 (*)

@sztomek sztomek modified the milestones: 8.10, 8.8 ❄️ Mar 20, 2026
@sztomek sztomek force-pushed the media3/01-foundation branch from 358a86c to 1b9673a Compare March 27, 2026 15:55
@sztomek sztomek merged commit 87fca7d into main Mar 31, 2026
19 checks passed
@sztomek sztomek deleted the media3/01-foundation branch March 31, 2026 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Area] Playback Episode playback issue [Type] Enhancement Improve an existing feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants