Skip to content

build: ⬆️ Migrate Android playback from ExoPlayer 2 to Media3 - #510

Open
victorrss wants to merge 4 commits into
SimformSolutionsPvtLtd:mainfrom
victorrss:build.migrate-android-media3
Open

build: ⬆️ Migrate Android playback from ExoPlayer 2 to Media3#510
victorrss wants to merge 4 commits into
SimformSolutionsPvtLtd:mainfrom
victorrss:build.migrate-android-media3

Conversation

@victorrss

@victorrss victorrss commented Aug 13, 2026

Copy link
Copy Markdown

Description

Standalone ExoPlayer 2 is discontinued. Android playback now uses Media3 ExoPlayer 1.11.0. The Dart PlayerController API is unchanged. Plugin minSdk is aligned to 23 (already documented) and compileSdk is 36 (required by Media3 1.11.0).

Checklist

  • The title of my PR starts with a Conventional Commit prefix (fix:, feat:, docs: etc).
  • I have followed the Contributor Guide when preparing my PR.
  • I have updated/added tests for ALL new/updated/fixed functionality.
  • I have updated/added relevant documentation in docs and added dartdoc comments with ///.
  • I have updated/added relevant examples in examples or docs.

There are no Android instrumented tests in this repo. Verified with flutter build apk --debug and by running the example app on an Android emulator (local MP3 prepare/play/pause). Gradle no longer resolves com.google.android.exoplayer2.

Android setup docs now require compileSdk 36. The example app compileSdk is updated to match. No Dart API or dartdoc changes.

Breaking Change?

  • Yes, this PR is a breaking change.
  • No, this PR is not a breaking change.

Related Issues

Closes #509

Replace discontinued ExoPlayer 2.17.1 with Media3 1.11.0 so Android playback stays on a supported library.

Co-authored-by: Cursor <cursoragent@cursor.com>
import androidx.media3.exoplayer.ExoPlayer
import io.flutter.plugin.common.MethodChannel

@OptIn(UnstableApi::class)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@OptIn(UnstableApi::class) is required because Media3 marks ExoPlayer.Builder as @UnstableApi. That is a binary-compatibility marker, not a quality warning — this surface has the same stability ExoPlayer 2 had for its whole API. Without the opt-in, Android lint fails the build (UnsafeOptInUsageError). See the Media3 migration guide.

victorrss and others added 3 commits August 13, 2026 18:18
Host apps must compile against API 36 because Media3 1.11.0 rejects lower compileSdk values.

Co-authored-by: Cursor <cursoragent@cursor.com>
Keep the changelog on a patch release instead of the unreleased 2.1.0 section.

Co-authored-by: Cursor <cursoragent@cursor.com>
Keep Media3 on the existing unreleased 2.1.0 heading instead of a 2.0.3 patch.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate Android playback from ExoPlayer 2 to Media3

1 participant