Repository navigation
Conversation
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>
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>
yash-fadadu-simform
left a comment
There was a problem hiding this comment.
Thanks for this. The migration itself works: playback behaves the same as on main, and switching to onPlaybackStateChanged is the right replacement for the deprecated callback. But the @OptIn added here fails Android lint, and Media3 1.11.0 forces compileSdk 36 and minSdk 23 on every app that uses the plugin, which the PR marks as not breaking. So I'm requesting changes.
Tested on a Pixel 7 emulator (API 36) with a scripted check that calls the PlayerController API on main and on this branch, plus Gradle lint on the plugin module:
| Case | main | This PR |
|---|---|---|
| Example APK builds | ✅ | ✅ |
:audio_waveforms:lintDebug |
✅ | ❌ UnsafeOptInUsageError at AudioPlayer.kt:14 |
| prepare, max duration (audio1.mp3) | ✅ 27167 ms | ✅ 27123 ms |
| play, pause, seekTo(3000), setRate, setVolume | ✅ | ✅ |
| Completion fires once for FinishMode pause, loop and stop | ✅ | ✅ |
| Second controller prepares and plays the same file | ✅ | ✅ |
| Invalid path throws PlatformException | ✅ | ✅ |
No com.google.android.exoplayer2 classes in the APK |
❌ | ✅ |
I also used the example app UI on this branch: play, pause, seeking by dragging the waveform, and two bubbles playing at once all worked. Not tested: network URLs, a real device, or anything below API 36.
Inline comments:
- Blocking
AudioPlayer.kt:@OptInresolves tokotlin.OptIn, so the opt-in is ignored and lint fails. Importandroidx.annotation.OptIn. - Blocking
android/build.gradle: Media3 1.11.0 requires compileSdk 36 and minSdk 23 in apps that use the plugin, so this is a breaking change. - Minor
CHANGELOG.md: use the**BREAKING:**prefix and list what apps need to change.
Could you squash the four commits into one? The changelog section moves to 2.0.3 and back again between them.
Without an import, @OptIn resolved to kotlin.OptIn, which ignores the UnstableApi marker and fails Android lint with UnsafeOptInUsageError. Media3 1.11.0 requires compileSdk 36 and minSdk 23 in consuming apps, so the CHANGELOG entry is now flagged as breaking.
|
Thanks @yash-fadadu-simform |
|
Is there any action you need from me? It seems your commit covers all the points, @yash-fadadu-simform |
Description
Standalone ExoPlayer 2 is discontinued. Android playback now uses Media3 ExoPlayer 1.11.0. The Dart
PlayerControllerAPI is unchanged. PluginminSdkis aligned to 23 (already documented) andcompileSdkis 36 (required by Media3 1.11.0).Checklist
fix:,feat:,docs:etc).docsand added dartdoc comments with///.examplesordocs.There are no Android instrumented tests in this repo. Verified with
flutter build apk --debugand by running the example app on an Android emulator (local MP3 prepare/play/pause). Gradle no longer resolvescom.google.android.exoplayer2.Android setup docs now require
compileSdk 36. The example appcompileSdkis updated to match. No Dart API or dartdoc changes.Breaking Change?
Related Issues
Closes #509