3
我正在使用ExoPlayer在循环中播放视频,但是在启动源视频之前,每个循环都需要重置我的布局的某些状态。我知道ExoPlayer正在调用onPlayerStateChanged与ExoPlayer.STATE_ENDED参数,当视频结束为通常的MediaSources,但它不被LoopingMediaSource调用。ExoPlayer,LoopingMediaSource的循环结束/已启动侦听器
@Override
public void onPlayerStateChanged(boolean playWhenReady, int playbackState) {
if (playbackState == ExoPlayer.STATE_ENDED) {
showControls();
resetLayoutStates(); //I need it here, even in LoopingMediaSource
}
updateButtonVisibilities();
}
当源代码重新启动或在循环中结束时,Exoplayer是否有任何回调?或者它对我的情况有任何解决方法?