views:

284

answers:

2

I am using MediaPlayer to play a video in my app. The video takes a while to buffer and the videoview is blank for that time.

Is there a way to start the buffering when the user is in the previous screen, so that when he comes to the video playing screen, the video is ready to play?

Thanks Chris

+1  A: 

MediaPlayer lets you register an OnPreparedListener and an OnBufferingUpdateListener.

JRL
A: 

I've not tried it, but you could try calling MediaPlayer.prepareAsync() while the user is on the previous screen, then call .start() when the user moves to the right screen. Not sure where the media player can live during this process... You might need to do this all within one activity that you dynamically update when the user wants to see the video.

Philip Pearl