Is there anyway that you can make the application keeps the buffer after orientation without manually handling the configuration changes.
The scenario basically:
Video buffer up until the latest point should be preserved when the orientation changes.
Need to reload a new layout (because portait and lanscape has different layout), Therefore letting the app restart the activity to reload new resources is the best way I think.
The video component is in a fragment.
Alternatives that I tried but are not acceptable:
The first work around is to save the position of the video and after the view has been created, use seekTo to go to the last point. However, this will cause the device to re-buffer again.
I'd tried playing around with fragment setRetainInstance(true) and ensure the media player is not reinitialize after orientation changes. After each onCreateView, I just set the mediaplayer.setDisplay() to a new surfaceholder. Unfortunately this cause the media player to go into error state which in turn requires the media player to be reseted.
Any suggestion / workaround for this?
Edited: I saw somewhere in stackoverflow that you can change the mediaplayer surface holder while the mediaplayer is active in android 4.0+. However, I am developing an app for android 3.x.