开发者

Missing HTTP_RANGE in iPhone

I'm trying to deliver an MP4 video to iPhone, 开发者_JAVA百科but as many of you might have known, it requires a slightly different method to do it. One key aspect is to detect $_SERVER{"HTTP_RANGE'] as shown in http://mobiforge.com/developing/story/content-delivery-mobile-devices and other numerous StackOverflow answers.

I did a print for $_SERVER and didn't find HTTP_RANGE in iOS Simulator and a real iPhone. Can someone shed a light for me?

Thanks!


If an iOS device is requesting an MP4, it makes multiple requests:

  1. The first 2 bytes. I think this is a test to see if the server will comply with byte range requests.
  2. A range of bytes in the middle of the file, but not all of it
  3. Repeat step 2 until finished playing video

You don't really have any control of that. The server must be capable of servering byte range requests properly, or the iOS device will not be able to play the video.

If you have the iPhone simulator request a plain HTML page that will display the HTTP request variables, it won't have the byte range request because iOS Safari did not make one. It only does that for MP4 files.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜