Control buffering in VideoView

2019-08-03 16:17发布

问题:

I'm trying to use a VideoView to display a mp4 video from Vimeo. Everything works fine but is there a way that I can control the buffering of the video? My problem is that I have 6 VideoView's in one view and as soon as the view loads all of them starts buffering right away. I would like them to only start buffering when i press play on one of them to lower internet usage.

Is there a way to start/stop the buffering?

回答1:

For your case: The VideoView wraps the MediaPlayer, making it unable to control the buffering. You would have to recreate the "VideoView" by taking a surface and a MediaPlayer, then calling PrepareAsync on the latter. Refer to this post for more details.