Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to display Image as video in exoplayer using setImageDurationMs and ImageOutput #1157

Closed
pawaom opened this issue Mar 7, 2024 · 5 comments
Assignees
Labels

Comments

@pawaom
Copy link

pawaom commented Mar 7, 2024

I am trying to display video and image in exoplayer using a playlist and show it in playerview

I have referred this this

But there is no demo example for this

can there be some demo code, about how to display video and image one after the other in exoplayer, I am not referring to Transformer but how to dsiplay it in a playerview or glsurfaceview etc , can we get some refrence demo code for this

@icbaker
Copy link
Collaborator

icbaker commented Mar 7, 2024

PlayerView doesn't currently support ImageOutput - this is tracked by #1144

So you currently need to wire up an ImageOutput to the player manually, and decide what to do with the bitmap that gets passed to it.

In the longer term, it's likely that the natural way to show video and images together in a single playback will be as part of a 'composition' similar to what Transformer can do today, but deisnged for realtime playback.

@pawaom
Copy link
Author

pawaom commented Mar 7, 2024

I understand that playerview doesnot support showing images

but according to this this there is some mechanism to show video and images

I just want to know how is it achieved

even this this mentions

ExoPlayer.setImageOutput that allows apps to set ImageRenderer.ImageOutput.
DefaultRenderersFactory now provides an ImageRenderer to the player by default with null ImageOutput and ImageDecoder.Factory.DEFAULT.

I jsut want to know can we display video and images in the playlist and how to do it

@icbaker
Copy link
Collaborator

icbaker commented Mar 7, 2024

Pass your ImageOutput implementation to ExoPlayer.setImageOutput and it should receive the decoded Bitmap objects for the images in your playlist.

It is up to you to implemente the transition between showing videos and images.

@pawaom
Copy link
Author

pawaom commented Mar 7, 2024

what is the way to display the image and video in playlist using exoplayer if not with playerview any other way, can you provide code sample, i tried searching it but nothing is available

@icbaker
Copy link
Collaborator

icbaker commented Mar 7, 2024

I'm afraid we don't have an example of this to share.

@androidx androidx locked and limited conversation to collaborators May 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants