3

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 ?

Lucas Goldner
  • 617
  • 9
  • 29
  • What's wrong with the state change event listening? What are you trying to do? – muratgu Sep 03 '20 at 16:41
  • 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 – Lucas Goldner Sep 03 '20 at 16:44

1 Answers1

3

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

Umair Ayub
  • 74
  • 2