Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chrome freezes when playing videos from Rackspace cloudfiles

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.

like image 249
Ben Avatar asked Feb 24 '11 23:02

Ben


1 Answers

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.

like image 83
Roger Thomas Avatar answered Sep 22 '22 21:09

Roger Thomas