Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to restart video on Exoplayer after ExoPlayer.STATE_ENDED

Tags:

I'm using Exoplayer with a base of the DemoPlayer. I want to restart/replay the video from beginning on some user action after that ExoPlayer.STATE_ENDED is dispatched.

I've tried to use seekTo(0) and mPlayer.setPlayWhenReady(true); after but it didn't do anything, at all.

like image 589
Hugo Gresse Avatar asked Aug 14 '15 08:08

Hugo Gresse


People also ask

How do you play the next ExoPlayer video?

1 Answer. Show activity on this post. 3] Just check by clicking next button from the media controller if that works then you are done, now the videos will be played automatically once finished the current one.

How do I get ExoPlayer thumbnails on Android?

As per the Exo player developer console, it's mentioned that Exo player only used for the Audio and Video. Add ImageView and Exoplayer in Framelayout. Show Image (That is knows as thumbnails) in imageView and on tap of ImageView Hide it and show ExoPlayer and play it.


1 Answers

I've updated the library to ExoPlayer r1.4.2 and it does the job...

    mPlayer.seekTo(0);     mPlayer.setPlayWhenReady(true); // replay from start 

// Pause video after restart

    mPlayer.seekTo(0);     mPlayer.setPlayWhenReady(false); 
like image 66
Hugo Gresse Avatar answered Sep 22 '22 20:09

Hugo Gresse