iPhone / iPad Safari需要视频的“Accept-Ranges”标头吗? [英] Does iPhone/iPad Safari require 'Accept-Ranges' header for video?
问题描述
我在使用移动版Safari浏览器播放我的开发者服务器中的视频时遇到问题。我的开发服务器不支持'Accept-Ranges'标题,在阅读了几个论坛后,我发现这可能是我的问题。 以下是论坛发帖示例那。
这是正确的吗?移动Safari是否需要Accept-Ranges标头?任何人都可以指出我的任何Apple文档实际上是这样说的吗?
谢谢。
我发现一些Apple文档说它确实需要视频。
托管媒体的HTTP服务器iOS文件必须支持字节范围
请求,iOS用于在媒体播放中执行随机访问。
(字节范围支持也称为内容范围或部分范围
支持。)大多数HTTP 1.1服务器已经支持
字节范围的请求。
如果您不确定媒体服务器是否支持字节范围
请求,则可以在OS X中打开终端应用程序,并使用
curl命令 - 从
服务器上的文件下载一个短片段: example.com/test.mov -o / dev / null
如果该工具报告它下载了100个字节,则媒体服务器正确
处理了字节范围请求。如果它下载整个文件,则
可能需要更新媒体服务器。
I've been having problems serving videos from my dev server that play in mobile Safari. My dev server does not support the 'Accept-Ranges' header and after reading a few forums I've discovered that may be my problem. Here is an example forum posting saying just that.
Is this correct? Does mobile Safari require the Accept-Ranges header? Can anyone point me to any Apple documentation actually stating that?
Thanks.
I found some Apple documentation that says that it does in fact need that for video.
HTTP servers hosting media files for iOS must support byte-range requests, which iOS uses to perform random access in media playback. (Byte-range support is also known as content-range or partial-range support.) Most, but not all, HTTP 1.1 servers already support byte-range requests.
If you are not sure whether your media server supports byte-range requests, you can open the Terminal application in OS X and use the curl command-line tool to download a short segment from a file on the server:
curl --range 0-99 http://example.com/test.mov -o /dev/null
If the tool reports that it downloaded 100 bytes, the media server correctly handled the byte-range request. If it downloads the entire file, you may need to update the media server.
这篇关于iPhone / iPad Safari需要视频的“Accept-Ranges”标头吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!