views:

21

answers:

1

Hello everyone !

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 !

A: 

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

christo16
I'm using Reachability class to determinate client connection type. When you say download a file to check the speed, how would you do this ? Download a file when starting the application ? Downloading file then playing it ? I want my file to be played when downloading (progressive download). Have you an idea ?
sui
You can start downloading a file from a server and check how many bytes are received over time, i.e. bytes (might want to convert to bits) per second. This isn't best solution when you're trying to stream video. I would highly recommend you use HTTP streaming. Otherwise make an assumption about the speed based on what type of connection.
christo16