html - Chrome 在播放 Rackspace 云文件中的视频时死机

标签 html google-chrome html5-video freeze

当我在 Rackspace 云文件服务器上托管视频时,chrome 似乎无法播放带有 html5 视频标签的视频。

在常规主机上完美运行,但是一旦我将视频与 rackspace cdn url 链接起来,Chrome 就会卡住(完全卡住,网站 UI 完全被阻止 - 一段时间后 Chrome 弹出一条消息说“以下页面已变得无响应bla bla bla").

视频文件很好,因为它与我链接到常规主机时相同。

对请求进行了一些监视,我最初认为问题是 webm 文件默认作为 application/octet-stream mime 类型进行服务器处理。我向 rackspace 提交了一张票,他们给了我一种在上传文件时强制使用 mime 类型的方法。这样做了,文件现在作为视频/webm 正确发送了。但是 Chrome 仍然卡住。

知道这里可能出了什么问题吗?

编辑:使用iheartvideo ,从机架空间加载视频会触发 MEDIA_ERR_SRC_NOT_SUPPORTED。本地网络服务器上的相同视频完全正常 (??)

编辑 2:使用最新的主流 chrome 在 mac 和 windows 上都会发生

编辑 3:curl -I 结果:

Rackspace(无工作):

HTTP/1.1 200 OK
Server: nginx/0.7.65
Content-Type: video/webm
Last-Modified: Thu, 24 Feb 2011 23:45:12 GMT
ETag: 7029f83b241aa691859012dfa047e20d
Content-Length: 20173074
Cache-Control: public, max-age=900
Expires: Fri, 25 Feb 2011 01:32:11 GMT
Date: Fri, 25 Feb 2011 01:17:11 GMT
Connection: keep-alive

Web 服务器(有效)

HTTP/1.1 200 OK
Date: Fri, 25 Feb 2011 01:17:51 GMT
Server: Apache
Last-Modified: Thu, 24 Feb 2011 03:56:26 GMT
ETag: "11a0b47-133d112-49cff32940e80"
Accept-Ranges: bytes
Content-Length: 20173074
Content-Type: text/plain

编辑 4:对于那些感兴趣的人,这是 rackscape 工作人员告诉我在文件上设置 webm 内容类型的方法:

The file browser is not smart enough to determine the content type video/webm. Unfortunately, there is not a way to change the content type of a file that has already been uploaded.

You'll need to use one of the API to re-upload your files with the correct content type.

You can also use curl from a linux/MacOS command line if available.

Using your username and api key run this command...

curl -I -X GET -H "X-Auth-User: USERNAME" -H "X-Auth-Key: API_KEY" https://auth.api.rackspacecloud.com/v1.0

From the output there are 2 important values.

X-Storage-Url: https://storage101.......
X-Storage-Token: Long hash

You can upload the files with,

curl -X PUT -T test.webm -H "Content-Type: video/webm" -H "Content-Length: FILESIZEINBYTE" -H "X-Auth-Token: TOKEN FROM RESPONSE ABOVE" https://STORAGE URL FROM RESPONSE ABOVE/test.webm

You must specify the content type, and you must give the correct length of bytes of what is being uploaded. If not you will get an invalid request error.

最佳答案

我经常使用 Rackspace API。 他们的 API 实际上允许您将容器设置为启用流式传输。我的第一直觉告诉我你还没有这样做。 我流式传输各种文件类型,它们都非常有用。

这里有关于启用 CDN 流媒体的容器的更多信息: http://docs.rackspace.com/files/api/v1/cf-devguide/content/Streaming-CDN-Enabled_Containers-d1f3721.html

希望这对您有所帮助,但如果没有,请告诉我,我不介意将一些 PHP 示例代码放在一起以帮助您。 这一切都很简单,但了解 Rackspace 实现的各种 API 操作有时可能是一项艰巨的任务。

关于html - Chrome 在播放 Rackspace 云文件中的视频时死机,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5111866/

相关文章:

html - 如何使用 Bootstrap Columns 换行?

html - flexbox 对齐内容不会在元素之间留下空间

firefox - 浏览器添加 www.和 .com 自动到服务器地址

javascript - Bootstrap 3 提交按钮在 Android 移动 Chrome 浏览器中不起作用

Html 5 视频抄送按钮

python - 在没有文件扩展名的Django中返回文件路径

javascript - 视频高清按钮,js播放器

php - 仅验证我的文本框中的数字和字母

html - 如何用图像填充提交按钮?

javascript - Google Chrome 的 webkitGetUserMedia - 如果用户忽略对话框怎么办?