iPhone 中缺少 HTTP_RANGE
我正在尝试将 MP4 视频传送到 iPhone,但正如你们中许多人可能知道的那样,它需要稍微不同的方法来实现。 一个关键方面是检测 $_SERVER{"HTTP_RANGE'],如 http:// /mobiforge.com/developing/story/content-delivery-mobile-devices 和其他众多 StackOverflow 答案。
我为 $_SERVER 打印了一份文件,但在 iOS 模拟器和真正的 iPhone 中没有找到 HTTP_RANGE。 有人能为我照亮吗?
谢谢!
I'm trying to deliver an MP4 video to iPhone, 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!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果 iOS 设备请求 MP4,它会发出多个请求:
您实际上对此没有任何控制权。服务器必须能够正确处理字节范围请求,否则 iOS 设备将无法播放视频。
如果您让 iPhone 模拟器请求一个将显示 HTTP 请求变量的纯 HTML 页面,则它不会有字节范围请求,因为 iOS Safari 没有发出字节范围请求。它仅对 MP4 文件执行此操作。
If an iOS device is requesting an MP4, it makes multiple requests:
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.