Detect pause/resume in ExoPlayer

后端 未结 7 1951
予麋鹿
予麋鹿 2021-02-06 23:02

I searched two days for this question in github but i can\'t find true answer . I want example for detecting pause / resume in ExoPlayer > 2.x . An

7条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-06 23:59

    It must be that since the other answers were posted, a new method has been provided in Player.EventListener. This works well for me:

    override fun onIsPlayingChanged(isPlaying: Boolean) {
        // your code here
    }
    

    If isPlaying is false, it is paused, otherwise playing.

提交回复
热议问题