Exoplayer how can you detect if someone clicks on the Play Button?

Viewed 698

I know I could test with PlayerStateChanged if something is playing or not but I need the moment someone presses the play button... Does somebody know the code for this ?

1 Answers

I want to make the player prepare(mediasource) only when the user clicks on the play button so I can save ressources otherwise it will keep loading everytime a video when I go into the feed.

Then you can just simply add a button to your layout and call prepare(mediaSource) whenever button is clicked.

BTW : you can override the control view of ExoPlayer to achieve the same

Related