Skip to content

Conversation

@gizemgizg
Copy link

[video_player] Fix Android MediaCodec crash by updating platform package versions

Description

This PR updates the platform-specific dependencies bundled inside the video_player package:

  • video_player_android
  • video_player_avfoundation
  • video_player_web
  • video_player_platform_interface

The versions shipped in the published video_player package were outdated compared to the latest stable releases on pub.dev.
This mismatch caused runtime decoding failures on some Android devices using hardware-accelerated video playback (MediaCodecVideoRenderer crash), especially on Huawei devices such as Huawei Mate 20 Lite (Kirin 710).

By updating the platform packages to their latest stable versions, hardware decoding becomes consistent across devices and the crash is resolved.

No API surface changes; purely dependency updates.

Fixes: (flutter/flutter#81804)

Before

  • Some Android devices experienced runtime crashes: "ExoPlaybackException: MediaCodecVideoRenderer error"
  • This occurred even with valid H.264 Baseline/Main profile videos.
  • Emulator and iOS played the same asset without issues.

After

  • Video playback works reliably on Huawei Mate 20 Lite and other affected Android devices.
  • No regressions observed on iOS, macOS, or Web.
  • Emulator still works as expected.
  • All tests pass.

Pre-Review Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene page, which explains my responsibilities.
  • I read and followed the relevant style guides and ran the auto-formatter.
  • I signed the CLA.
  • The title of the PR starts with the name of the package surrounded by square brackets, e.g. [video_player]
  • I linked to at least one issue that this PR fixes.
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy, or I have commented below to indicate which version change exemption this PR falls under1.
  • I updated CHANGELOG.md to add a description of the change, following repository CHANGELOG style, or I have commented below to indicate which CHANGELOG exemption this PR falls under1.
  • I updated/added any relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or I have commented below to indicate which test exemption this PR falls under1.
  • All existing and new tests are passing.

Test Exemption:
This PR only updates dependency versions of platform implementations and does not change any logic, API behavior, or code paths. Existing tests sufficiently cover the affected surfaces.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

Footnotes

  1. Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. 2 3

Updated platform dependency versions for stability and fixed a crash on some Android devices.
@google-cla
Copy link

google-cla bot commented Nov 16, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the platform-specific dependencies for the video_player package to resolve a MediaCodecVideoRenderer crash on certain Android devices. The changes correctly bump the package version and update the CHANGELOG.md. My review includes a suggestion to improve the changelog's readability and points out a dependency version mismatch for video_player_android that should be addressed to ensure the latest version is used.

video_player_avfoundation: ^2.7.0
video_player_platform_interface: ^6.3.0
video_player_web: ^2.1.0
video_player_android: ^2.8.17

Choose a reason for hiding this comment

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

high

It seems the version for video_player_android is not the latest available in this branch. The pubspec.yaml for video_player_android indicates version 2.8.18, but this file updates the dependency to ^2.8.17. To ensure the latest fixes are included, this should be updated to ^2.8.18.

  video_player_android: ^2.8.18

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@stuartmorgan-g
Copy link
Collaborator

Thanks for the contribution, but outside of exceptional cases we do not do this.

The versions shipped in the published video_player package were outdated

video_player does not ship its dependencies, it sets version ranges for them to resolve to.

This mismatch caused runtime decoding failures on some Android devices

There is no mismatch between the current version range specifications in video_player and the current versions of video_player_*; the ranges include the current versions for all packages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants