@Override
public void onPlayerStateChanged(boolean playWhenReady, int playbackState) {
    switch (playbackState) {
        case Player.STATE_IDLE:  **//1.When this happens ?**

            if (playWhenReady==false) {  **//2.What "playWhenReady" indicate ?**

                **//3.When this condition occur ?**
            }
            else{
                **//4.When this condition occur ?**
            }
            break;
    }
}


什么是“ onPlayerStateChanged(boolean playWhenReady,intplayingState)”方法中的“ playWhenReady”? &玩家何时进入“ Player.STATE_IDLE”?给定代码中提到的所有四个阶段何时发生?

最佳答案

以下链接回答您的问题。


http://google.github.io/ExoPlayer/doc/reference/com/google/android/exoplayer2/Player.EventListener.html#onPlayerStateChanged-boolean-int-
http://google.github.io/ExoPlayer/doc/reference/com/google/android/exoplayer2/Player.html#STATE_IDLE

07-27 13:38