Integrate ExoPlayer with Anvil layouts?
DavidMihola opened this issue · 1 comments
DavidMihola commented
Hi,
one reason that has kept me from trying Anvil out more is that almost everything I've worked on in the last year has included video playback with Google's ExoPlayer.
In case you are not familiar with it, ExoPlayer does not provide any View
s itself but is instead attached to either a SurfaceView
or a TextureView
into which it then renders the video frames.
Do you have any ideas how one would integrate this in an Anvil layout? Is there a way to do it directly or do you think we'd need to wrap ExoPlayer and it's SurfaceView
in some View
of our own and then use that in Anvil?
Thanks for any suggestions!
David
I60R commented
override fun view() {
textureView {
val view: TextureView = Anvil.currentView()
// instanceOfPlayer.renderInto(view) <—— should work
}
}