Android VideoView, seamless playback during orientation change

I'm using a VideoView to play a mp4 file in my application. Is there a way to save all the content that was buffered so when the orientation of the screen is changed the user doesn't have to wait another 10 seconds or more for the video to start playing again.

Perhaps "saving the buffered video" isn't the right solution, I'm just looking for a way to have the playback almost appear seamless when the orientation of the screen is changed.

I'm already saving the video positioning and using the "seekTo" method to start the video where it left off. But I'm looking to prevent the rebuffering as well. I searched all over stackoverflow and couldn't find any discussions on this.

Thanks!

Bradley4


You could handle the configuration change yourself so that the application isn't restarted.

Another solution might be to put the VideoView into a Fragment. Then rather than killing the Fragment with the Activity, you might just pause the video detach the Fragment and re-attach after the configuration change. Although now that I think about it, I think the Fragment may also be re-created on the configuration change...

Very interested in how you solve this, please post your solution if no one answers.

链接地址: http://www.djcxy.com/p/8118.html

上一篇: Android相机为一些用户拍摄多行内嵌的图片

下一篇: Android VideoView,在方向更改期间无缝播放