androidx / androidx/media

Compose PlayerSurface getting black background colour on Android 10 (Real Device)

Open
#3,285 0 comments 4 reactions 1 assignee View on GitHub

@oceanjules is already working on this.

Since Jun 19, 2026.

bug needs triage
Dominant language
Java
Stars
3k
Forks
955
Avg merge
12d 14h
Merged PRs (30d)
2

Description

Version

Media3 main branch

More version details

I encountered same issue like this report, but somehow it is marked only for emulator. After trying to run it with real device, i can reproduce it. I use Media3's compose demo for this sample. Here is the comparison:

Samsung A53 - Android 16 One UI 8 (Works fine)

Running Device Layout Inspector
Image Image

Vivo 1935/Y50 - Android 10 Funtouch 10 (Blackout)

Running Device Layout Inspector
Image Image

Additional Notes:
Changing the surface type to SURFACE_TYPE_TEXTURE_VIEW able to fix this on some cases, but on secured content, like DRM protected content, it gives MediaCodecVideoRenderer. Unfortunately i cant put the content here since it is private but you can test with Widevine content from main demo app. But i can give you the exception log:

code=ERROR_CODE_DECODER_INIT_FAILED message=MediaCodecVideoRenderer error, index=0, format=Format(1781824546611item-02item, null, video/mp4, video/avc, avc1.4D401F, 1000000, und, [960, 540, 25.0, ColorInfo(BT709, Limited range, SDR SMPTE 170M, false, 8bit Luma, 8bit Chroma)], [-1, -1]), format_supported=YES (Fix with AI)
                                                                                                    androidx.media3.exoplayer.ExoPlaybackException: MediaCodecVideoRenderer error, index=0, format=Format(1781824546611item-02item, null, video/mp4, video/avc, avc1.4D401F, 1000000, und, [960, 540, 25.0, ColorInfo(BT709, Limited range, SDR SMPTE 170M, false, 8bit Luma, 8bit Chroma)], [-1, -1]), format_supported=YES
                                                                                                        at androidx.media3.exoplayer.BaseRenderer.createRendererException(BaseRenderer.java:558)
                                                                                                        at androidx.media3.exoplayer.BaseRenderer.createRendererException(BaseRenderer.java:527)
                                                                                                        at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.maybeInitCodecOrBypass(MediaCodecRenderer.java:614)
                                                                                                        at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.onInputFormatChanged(MediaCodecRenderer.java:1786)
                                                                                                        at androidx.media3.exoplayer.video.MediaCodecVideoRenderer.onInputFormatChanged(MediaCodecVideoRenderer.java:1608)
                                                                                                        at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.readSourceOmittingSampleData(MediaCodecRenderer.java:1206)
                                                                                                        at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:937)
                                                                                                        at androidx.media3.exoplayer.video.MediaCodecVideoRenderer.render(MediaCodecVideoRenderer.java:1383)
                                                                                                        at androidx.media3.exoplayer.RendererHolder.render(RendererHolder.java:392)
                                                                                                        at androidx.media3.exoplayer.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:1388)
                                                                                                        at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:711)
                                                                                                        at android.os.Handler.dispatchMessage(Handler.java:103)
                                                                                                        at android.os.Looper.loop(Looper.java:230)
                                                                                                        at android.os.HandlerThread.run(HandlerThread.java:67)
                                                                                                    Caused by: androidx.media3.exoplayer.mediacodec.MediaCodecRenderer$DecoderInitializationException: Decoder init failed: OMX.qcom.video.decoder.avc.secure, Format(1781824546611item-02item, null, video/mp4, video/avc, avc1.4D401F, 1000000, und, [960, 540, 25.0, ColorInfo(BT709, Limited range, SDR SMPTE 170M, false, 8bit Luma, 8bit Chroma)], [-1, -1])
                                                                                                        at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.maybeInitCodecWithFallback(MediaCodecRenderer.java:1311)
                                                                                                        at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.maybeInitCodecOrBypass(MediaCodecRenderer.java:612)
                                                                                                        at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.onInputFormatChanged(MediaCodecRenderer.java:1786) 
                                                                                                        at androidx.media3.exoplayer.video.MediaCodecVideoRenderer.onInputFormatChanged(MediaCodecVideoRenderer.java:1608) 
                                                                                                        at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.readSourceOmittingSampleData(MediaCodecRenderer.java:1206) 
                                                                                                        at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:937) 
                                                                                                        at androidx.media3.exoplayer.video.MediaCodecVideoRenderer.render(MediaCodecVideoRenderer.java:1383) 
                                                                                                        at androidx.media3.exoplayer.RendererHolder.render(RendererHolder.java:392) 
                                                                                                        at androidx.media3.exoplayer.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:1388) 
                                                                                                        at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:711) 
                                                                                                        at android.os.Handler.dispatchMessage(Handler.java:103) 
                                                                                                        at android.os.Looper.loop(Looper.java:230) 
                                                                                                        at android.os.HandlerThread.run(HandlerThread.java:67) 
                                                                                                    Caused by: android.media.MediaCodec$CodecException: start failed
                                                                                                        at android.media.MediaCodec.native_start(Native Method)
                                                                                                        at android.media.MediaCodec.start(MediaCodec.java:2131)
                                                                                                        at androidx.media3.exoplayer.mediacodec.SynchronousMediaCodecAdapter$Factory.createAdapter(SynchronousMediaCodecAdapter.java:65)
                                                                                                        at androidx.media3.exoplayer.mediacodec.DefaultMediaCodecAdapterFactory.createAdapter(DefaultMediaCodecAdapterFactory.java:165)
                                                                                                        at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.initCodec(MediaCodecRenderer.java:1390)
                                                                                                        at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.maybeInitCodecWithFallback(MediaCodecRenderer.java:1304)

EDITED: update the texture view explanation that turns out related to DRM protected content.

Devices that reproduce the issue

Vivo 1935/Y50 Funtouch OS 10

Devices that do not reproduce the issue

Samsung A53 One UI 8

Reproducible in the demo app?

Yes

Reproduction steps
  1. Add padding and background color to Box that wraps the Player Composable to make the difference visible
Box(
modifier.fillMaxSize().background(Color.Green).statusBarsPadding().background(Color.Red).padding(vertical = 64.dp)) {
....
  1. Play video "Video (MKV) -> Audio Only -> Video Only"
Expected result

Same behavior between suported OS, which is other UI component background not getting blacked out without feature parity

Actual result

Other UI component getting black background on Android 10 if using SURFACE_TYPE_SURFACE_VIEW, while SURFACE_TYPE_TEXTURE_VIEW gives decoder error on some video.

Media

Video (MKV) -> Audio Only -> Video Only

Bug Report
  • You will email the zip file produced by adb bugreport to android-media-github@google.com after filing this issue.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.