iPhone/iPad Safari 是否需要视频的“接受范围"标头? [英] Does iPhone/iPad Safari require 'Accept-Ranges' header for video?

查看:25
本文介绍了iPhone/iPad Safari 是否需要视频的“接受范围"标头?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从我的开发服务器提供在移动 Safari 中播放的视频时遇到问题.我的开发服务器不支持Accept-Ranges"标头,在阅读了一些论坛后,我发现这可能是我的问题.这是一个示例论坛帖子,上面说那.

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.

这是正确的吗?移动 Safari 是否需要 Accept-Ranges 标头?任何人都可以指点我任何实际说明这一点的 Apple 文档吗?

Is this correct? Does mobile Safari require the Accept-Ranges header? Can anyone point me to any Apple documentation actually stating that?

谢谢.

推荐答案

我发现一些 Apple 文档说它实际上确实需要视频.

I found some Apple documentation that says that it does in fact need that for video.

为 iOS 托管媒体文件的 HTTP 服务器必须支持字节范围请求,iOS 使用它在媒体播放中执行随机访问.(字节范围支持也称为内容范围或部分范围支持.)大多数(但不是全部)HTTP 1.1 服务器已经支持字节范围请求.

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.

如果您不确定您的媒体服务器是否支持字节范围请求,您可以在 OS X 中打开终端应用程序并使用curl 命令行工具从文件中下载一个短段服务器:

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

如果工具报告它下载了 100 字节,则媒体服务器正确处理字节范围请求.如果它下载整个文件,您可能需要更新媒体服务器.

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.

来源:Apple 文档

这篇关于iPhone/iPad Safari 是否需要视频的“接受范围"标头?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆