android VideoView增加缓冲

发布于 2024-10-17 18:15:35 字数 266 浏览 3 评论 0原文

我编写了一个视频播放器,可以播放网站上的视频。我的视频播放器实际上是来自 android 的 VideoView 小工具。

当我在 wifi 网络上时,视频可以正常播放,如果我按预期切换到 3G,情况就不一样了:D。我想要的是增加流缓冲区,似乎 VideoView 将视频流传输至剪辑大小的 8%。

当我按下播放按钮时,流媒体仍在播放,但它保持了百分比距离...如果我按下暂停,流媒体就会停止..

我可以增加流媒体长度并使视频流在暂停时播放吗?

谢谢你!

I have writen a video player that plays videos from a website. My videoplayer is actualy the VideoView gadget from android.

The videos are playing ok when I am on the wifi network, the things are not the same if I switch to 3G as expected :D. What I want is to increase the streaming buffer, it seems that VideoView is streaming the video up to 8% of the clip size.

When I press the play button, the streaming its still coming but it keeps that percentage distance... and if I press pause, the streaming is stopping..

Can I increase the streaming length and make the video streaming while in pause?

Thank you!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

铃予 2024-10-24 18:15:35

您可以自己将流读取到本地文件并将 VideoView 指向该文件。我不确定你可以存储多少。另外,VideoView 能否对所指向的文件的固定大小做出良好的反应。您可以创建正确大小的文件,但是您必须确保读取的视频不会超出您缓存的点。

You could possibly read the stream yourself to a local file and point the VideoView to that. I'm not sure however how much you're allowed to store. Also, will the VideoView react well the fixed size of the file as it was pointed to. You could possibly create the file in correct size, but then you will have to make sure that video is not read beyond the point you have cached.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文