Exoplayer 如何检测是否有人点击了播放按钮?

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

我知道我可以用 PlayerStateChanged 测试是否有东西在播放,但我需要有人按下播放按钮的那一刻...有人知道这个代码吗?

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.

然后您只需在布局中添加一个按钮,并在单击按钮时调用 prepare(mediaSource)。

顺便说一句:您可以覆盖 ExoPlayer 的控制视图来实现相同的效果