直接从网络流(http)播放媒体(视频)

发布于 2024-10-18 17:56:07 字数 227 浏览 8 评论 0原文

我想直接从网络流(http)播放媒体(视频),因此我必须以某种方式向 Android MediaPlayer 提供数据。

我有 FileOutputStream outstream = new FileOutputStream(outputfile);我通过 outstream.write(buffer, 0, count); 写入输出文件

是否有任何以流作为输入的API....???....请帮助...

I would like play media (video) from a network stream(http) directly, hence so I have to somehow feed Android MediaPlayer with the data.

I have FileOutputStream outstream = new FileOutputStream(outputfile); which I write into the outputfile by outstream.write(buffer, 0, count);

Is there any API which takes stream as input....???.... Please help...

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

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

发布评论

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

评论(1

好菇凉咱不稀罕他 2024-10-25 17:56:07

Android 支持渐进式下载和 HTTP Live Streaming(仅在 3.0 中),并且这两者都通过 HTTP 工作。

您可以使用 VideoViewMediaplayer 来利用渐进式下载和播放视频:请参阅讨论。

另外,如果您的服务器提供符合 Apple 的 Http Live Streaming IETF 草案,您可以直接向 MediaPlayer 提供 URL 并使用 SurfaceView 播放视频。注意:您必须将 URL 中的“http”替换为“httplive:”。

Android supports Progressive download and HTTP Live Streaming(only in 3.0) and both of these work over HTTP.

You can use VideoView or Mediaplayer to leverage Progressive downloading and play your videos: see this discussion.

Also, if your server, delivers segmented files(.ts) in conformance to Apple's Http Live Streaming IETF draft, you can directly supply the URL to MediaPlayer and play your video using SurfaceView. Note: that you will have to replace "http" with "httplive:" in your URL.

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