My solution is to save the current playing time by YouTubePlayer getCurrentTimeMillis() in onSaveInstanceState(Bundle state) when screen rotation gets triggered, and get the time back from onRestoreInstanceState(Bundle state).
Sample code would be:
static final String CURRENT_PLAY_TIME = "current_play_time";
int current_time;
@Override
protected void onSaveInstanceState(Bundle state) {
super.onSaveInstanceState(state);
state.putInt(CURRENT_PLAY_TIME, youTubePlayer.getCurrentTimeMillis());
}
@Override
protected void onRestoreInstanceState(Bundle state) {
super.onRestoreInstanceState(state);
current_time = state.getInt(CURRENT_PLAY_TIME);
}
And after restoring the current playing time let YouTubePlayer load video with it.
youTubePlayer.loadVideo(VIDEO_ID, current_time);
Hope it helps!