ExoPlayer icon indicating copy to clipboard operation
ExoPlayer copied to clipboard

Add Official Support for JetPack Compose

Open buddudevelopers opened this issue 3 years ago • 10 comments

Before filing a feature request:

  • Search existing open issues, specifically with the label ‘enhancement’: https://github.com/google/ExoPlayer/labels/enhancement
  • Search existing pull requests: https://github.com/google/ExoPlayer/pulls

When filing a feature request:

Replace the content in the sections below.

[REQUIRED] Use case description

It would be great to support Jetpack compose. Currently its not supported yet its an official google way of building UI on android.

Proposed solution

A clear and concise description of your proposed solution, if you have one.

Alternatives considered

There are tutorial online of adding exoplayer to AndroidView but there are reports of performance issues. like this example repo https://github.com/spencergriffin/exoplayer-compose

buddudevelopers avatar Nov 06 '21 10:11 buddudevelopers

Strongly agree, it should be supported to call it declaratively instead of via AndroidView{}

re-ovo avatar Feb 02 '22 13:02 re-ovo

I made an implementation which is very flexible and declarative, though only the basic features are implemented so far. Mind to take a look? compose-video-player

imherrera avatar Feb 03 '22 03:02 imherrera

Any updates on this? Quite some time has passed, and the performance on Compose is not ideal I would say. Seeing some black screens when rendering the View and it looks glitchy at times.

DonnyRozendal avatar Jul 04 '22 13:07 DonnyRozendal

Hello,

Could you give us some details on how/when you're planning to support Compose ?

Thank you

yoobi avatar Sep 22 '22 07:09 yoobi

This is great example on how to implement ExoPlayer in Compose way https://github.com/fengdai/compose-media

alaegin avatar Oct 08 '22 20:10 alaegin

This is crazy it's just been silence for so long. Could we at least get some kind of response, even if you don't know when? Are you ever planning on supporting compose natively without an AndroidView, this is causing many problems.

joshuamking avatar Mar 08 '23 20:03 joshuamking

Are you ever planning on supporting compose natively without an AndroidView, this is causing many problems.

For those that still use an AndroidView though, take a look at this issue, because Compose devs just recently implemented view reusability for AndroidViews inside Compose: https://issuetracker.google.com/issues/230099236

gajicm93 avatar Mar 22 '23 12:03 gajicm93

Thank you for this request. We're aware that support for Jetpack Compose is highly requested and we're looking into it.

As part of supporting Compose, the media3 library needs a Kotlin-friendly API, which is why we're prioritizing work on https://github.com/androidx/media/issues/599 first

JolandaVerhoef avatar Aug 22 '23 08:08 JolandaVerhoef