ExoPlayer “MediaCodecVideoRenderer error” when playing video in Flutter

Integrations

Hi everyone,

I'm running into a persistent issue when playing videos in my Flutter app on Android using video_player (which uses ExoPlayer under the hood). The app throws the following error:

androidx.media3.exoplayer.ExoPlaybackException: MediaCodecVideoRenderer error, index=0, format=Format(1, null, null, video/avc, avc1.4D401F, -1, null, [480, 854, 29.998442, ColorInfo(BT709, Limited range, SDR SMPTE 170M, false, 8bit Luma, 8bit Chroma)], [-1, -1]), format_supported=YES

Caused by: androidx.media3.exoplayer.mediacodec.MediaCodecRenderer$DecoderInitializationException: Decoder init failed: c2.exynos.h264.decoder

Caused by: java.lang.IllegalStateException: Block model is only valid with callback set (async mode)

It shows up as:

Error initializing video controller: PlatformException(VideoError, Video player had error ...)

What I’ve checked so far:

The video is H.264 (video/avc) and plays fine on other devices.

I’ve tried different video resolutions and formats, still the same issue.

The ExoPlayer format_supported=YES suggests the format should work.

Device:

Samsung (Exynos chipset)

Android 11+

💻 My video player code (Flutter) is here:
👉 My Code (Google Docs)

If anyone has faced this before or has suggestions on handling ExoPlayer codec issues in Flutter, I'd appreciate your help!

Thanks in advance!


What have you tried so far?
Did you check FlutterFlow's Documentation for this topic?
No
3