VideoView中的控件缓冲 [英] Control buffering in VideoView
问题描述
我正在尝试使用VideoView来显示Vimeo的mp4视频.一切正常,但是有什么方法可以控制视频的缓冲吗?我的问题是,我在一个视图中有6个VideoView,并且在视图加载后,所有这些都立即开始缓冲.我希望它们仅在我按其中之一的播放键以降低Internet使用率时才开始缓冲.
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?
推荐答案
对于您的情况:VideoView包装了MediaPlayer,使其无法控制缓冲.您必须通过获取一个曲面和一个MediaPlayer,然后在后者上调用PrepareAsync,来重新创建"VideoView".有关更多详细信息,请参见这篇文章.
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.
这篇关于VideoView中的控件缓冲的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!