MPMoviePlayerController:一种获取已用带宽的方法?

发布于 2024-09-29 07:37:40 字数 207 浏览 1 评论 0原文

我想检查使用 MPMoviePlayerController 播放视频时使用的带宽,以便能够播放与客户端带宽匹配的视频。

现在,我使用 NSURLConnection 下载文件的一部分,并且可以找到带宽。但我认为下载比预期更多的数据并不是一个好主意(目标是使用尽可能少的带宽)。

是否存在“当前下载的字节”属性或类似的属性?我希望你能帮助我。

多谢 !

I would like to check used bandwidth when playing a video with MPMoviePlayerController to be able to play a video which matched client bandwidth.

For now, I download a part of my file by using NSURLConnection and I can find bandwidth. But I think it's not a good idea to download more data than expected (and the goal is to use as less bandwidth as possible).

Does a 'current downloaded bytes' property, or something like that, exist ? I hope you can help me.

Thanks a lot !

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

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

发布评论

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

评论(1

挽你眉间 2024-10-06 07:37:40

看一下 Reachability 示例代码,它将帮助您确定客户端是否使用 WiFi、WWAN(3G/Edge)等。您可以根据这些发现做出某些假设。如果您想要准确的速度,您可以下载一个文件并检查速度。

您可能想要研究 HTTP 视频流,您可以为每种连接速度提供不同(不同质量级别)的视频版本。服务器确定要发送的版本。

有关 HTTP 流媒体的一些文档:

http://developer .apple.com/iphone/library/documentation/NetworkingInternet/Conceptual/StreamingMediaGuide/Introduction/Introduction.html

http://www.scribd.com/doc/20173481/iPhone-Streaming

Take a look at the Reachability sample code, it will help you determine if the client is on WiFi,WWAN (3G/Edge), etc. You can make certain assumptions based on these findings. If you want exact speed, you'll download a file and check the speed.

You may want to look into HTTP video streaming, you can provide different (varying level of quality) versions of the video for each connection speed. The server determines the version to send.

Some docs on HTTP Streaming:

http://developer.apple.com/iphone/library/documentation/NetworkingInternet/Conceptual/StreamingMediaGuide/Introduction/Introduction.html

http://www.scribd.com/doc/20173481/iPhone-Streaming

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