Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how can I Display image in ExoPlayer?

I have list of URLs mix with videos and images. I want to display both using ExoPlayer. I could display videos in the ExoPlayer, however when I try to display image I am getting a black screen.

Thank you in advance.

like image 623
user3423277 Avatar asked Jun 13 '18 05:06

user3423277


1 Answers

I use exoplayer-ui:r2.5.4 and SimpleExoPlayerView has built in image view.
you can set your image with default_artwork attribute in xml, for example:

<com.google.android.exoplayer2.ui.SimpleExoPlayerView
    android:id="@+id/playerView"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:default_artwork="@drawable/default_media_artwork"
    app:use_artwork="true"/>

Hope to be useful.

like image 98
naser khsoravi Avatar answered Sep 28 '22 19:09

naser khsoravi