Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

Using Content-range HTTP header for streaming


I find it quite strange that for http streaming and jumping to unread video part there are non-standard GET parameters used to mark readable content start. There is nice standard way to do this: just add standard (but probably not well-known) HTTP 1.1 header "Content-Range" to the GET request and it will do exactly the same that with adding "?start=xxx" to xmoov script or lighttp specific module.

I would be very interested in this as I plan to use Amazon S3 which is dump storage with HTTP interface, so you cannot add any modules or custom code there, but it uses lighttp streaming if you just use the standard Content-Range headers, according to http://developer.amazonwebservices.com/connect/message.jspa?messageID=66774

Or is there any limit in flash player stopping you using the header?

11 Community Answers

JW Player

User  
0 rated :

I *think* the main-problem is: How should the player know the byte-range of a given frame/second? Or to say it better: How should the player know on which byte-position the given seek-position starts? That is done server-side.

JeroenW

JW Player Support Agent  
0 rated :

The byteranges can be retrieved from metadata in case of FLV / MP4 streams.

The bigger problem however is that Flash cannot send requestheaders, so the Content-Range functionality of Apache / Lighttpd cannot be accessed.

JW Player

User  
0 rated :

I think there should be some ways to do that, one is described in http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/net/NetConnection.html#addHeader() . However, there could be limitations that some headers cannot be sent, and some require crossdomain.xml definition; as I understand from http://kb.adobe.com/selfservice/viewContent.do?externalId=kb403030 and http://kb.adobe.com/selfservice/viewContent.do?externalId=kb403185 then Request-Range is one of the forbidden headers, but these refer to http/xmlconnection, not netconnection?

JeroenW

JW Player Support Agent  
0 rated :

The addHeader() function is not for HTTP headers, but for AFM headers, a proprietary protocol Flash uses to communicate between plugins and Flash Mediaserver. So besides requesting the URL itself, no part of the HTTP protocol can be used for video requests.

JeroenW

JW Player Support Agent  
0 rated :

very unfortunate that is…

JW Player

User  
0 rated :

Will it be possible to do HTTP GET with Request-Range in Flash 10?
If not, is there a way to add a plugin written in C/C++ ?

Thanks

JW Player

User  
0 rated :

What about the methods described here?:
http://kb2.adobe.com/cps/403/kb403185.html

I'd like to be able to use Content-Range headers for receiving MP3 files from the same domain, if it's possible.

JW Player

User  
0 rated :

It does look like most useful HTTP headers can't be sent by Flash:
http://help.adobe.com/en_US/AS3LCR/Flash_10.0/flash/net/URLRequestHeader.html

JW Player

User  
0 rated :

However, it does seem that if the media-serving site has the appropriate "allow-http-request-headers-from" element in its crossdomain.xml then the header should be sent.

Also, it's not clear whether the headers are actually blocked in requests to the same domain...

JW Player

User  
0 rated :

This issue comes up every few months.

The answer is always the same, "You can't make Range requests with the Adobe Flash Player".

Many very knowledgable people have looked into this and have come to the same conclusion.

If you could make Range requests, there would be no need for the various pseudostreaming solutions using scripts and server modules.

For streaming MP3s, an RTMP server such as Red5 is the best solution, because you can't use pseudostreaming for MP3s unless you put the MP3 in an FLV container.

JW Player

User  
0 rated :

From: *http://kb2.adobe.com/cps/403/kb403185.html*

[i]"Note: *Some headers cannot be sent by the Flash Player at all.* For a complete list of blacklisted headers, refer to "You receive an ActionScript error when an HTTP send action contains certain headers" (TechNote kb403030)."[/i]

From: *http://kb2.adobe.com/cps/403/kb403030.html*

[i]"Prior to Flash Player 9, the following headers were blocked:
headers:
Age
Allow
Allowed
Connection
Content-Length
Content-Location
Content-Range
ETag
Host
Last-Modified
Location
Max-Forwards
Proxy-Authenticate
Proxy-Authorization
Public
*Range *
..."[/i]

Notice that the *Range* request is blocked.

(Content-Range would be a server response header sent in response to a Range request.)

This question has received the maximum number of answers.