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 ?
Asked
Active
Viewed 1,090 times
3
-
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 Answers
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