Chrome 在播放 Rackspace 云文件中的视频时冻结

发布于 2024-10-18 21:34:35 字数 2295 浏览 2 评论 0原文

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

在常规托管上完美运行,但一旦我将视频与rackspace cdn url链接,Chrome就会冻结(完全冻结,网站用户界面完全被阻止 - 过了一会儿,Chrome会弹出一条消息,说“以下页面已变得无响应bla bla bla” ”)。

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

对请求进行了一些监视,我最初认为问题是 webm 文件默认作为 application/octet-stream mime-type 提供服务。我向rackspace 提交了一张票,他们给了我一种在上传文件时强制使用mime 类型的方法。这样做了,文件现在已正确发送为 video/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 内容类型:

文件浏览器不够智能 确定内容类型 视频/网络管理。不幸的是,有 不是更改内容类型的方法 一个已经存在的文件 已上传。

您需要使用其中一个 API 来 使用正确的内容重新上传您的文件 内容类型。

您还可以使用来自 linux/MacOS 命令行(如果可用)。

使用您的用户名和 api 密钥运行 这个命令...

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

从输出中有 2 个重要的 价值观。

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

您可以使用以下方式上传文件:

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

您必须指定内容类型,并且 你必须给出正确的长度 正在上传的字节数。如果 不会,您会收到无效请求 错误。

Can't seem to get chrome to play videos with html5 video tag when I host them on a Rackspace cloudfiles server.

Works perfectly on the regular hosting, but as soon as I link the video with the rackspace cdn url, Chrome freezes (total freeze, website UI completely blocked - after a while Chrome pops a message saying "The following page has become unresponsive bla bla bla").

The video file is fine as it's same as when I link to the regular hosting.

Did a bit of spying on the requests, and I initially thought the problem was that the webm files were serverd by default as application/octet-stream mime-type. I lodged a ticket to rackspace and they gave me a way to force the mime-type when uploading the file. Did that, and the file is now correctly sent as video/webm.. but Chrome still freezes.

Any idea what could be going wrong here?

EDIT: using iheartvideo, loading the video from rackspace triggers a MEDIA_ERR_SRC_NOT_SUPPORTED. Same video off local web server works totally fine (??)

EDIT 2: Happens on both mac and windows with latest mainstream chrome

EDIT 3: curl -I results:

Rackspace (no worky):

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 Server (worky)

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

EDIT 4: For those interested, this is what the rackscape crew told me to do to set a webm content type on a file:

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

旧伤慢歌 2024-10-25 21:34:35

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

有关启用 CDN 流的容器的更多信息,请参见此处:
http://docs.rackspace .com/files/api/v1/cf-devguide/content/Streaming-CDN-Enabled_Containers-d1f3721.html

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

I work quite a bit with the Rackspace API.
Their API actually allows you to set a container as streaming enabled. My first instinct tells me that you haven't done this.
I stream various file types and they all work an absolute treat.

There is more information about CDN Streaming Enabled containers here:
http://docs.rackspace.com/files/api/v1/cf-devguide/content/Streaming-CDN-Enabled_Containers-d1f3721.html

Hopefully this helps, but if not let me know and I don't mind putting some PHP example code together to help you along.
Its all quite easy, but getting your head around the various API operations that Rackspace have implemented can sometimes be a daunting task.

童话里做英雄 2024-10-25 21:34:35

我没有具体的答案,只是一些想法:

  1. 在其他浏览器中怎么样?
  2. 它在 Web 服务器上工作,上面的内容类型是文本/纯文本,那么为什么要强制使用视频/WebM?
  3. Rackspace 可以为您提供(或者您可以在他们的网站或其他人的网站上找到)一些可以播放的示例内容,以便您可以检查它吗?

您可以尝试 Brightcove 或 Bitgravity 的免费试用版,看看是否有效...

I don't have a concrete answer, just some thoughts:

  1. what about in other browsers?
  2. it works on the web server with the content type above is text/plain so why force to video/webm?
  3. can Rackspace provide you (or can you find on their site or someone else's) some sample content that does play so you can inspect it?

You could try the free trial from Brightcove or Bitgravity and see if that works...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文