I'm streaming audio files from a Node.js Express server with Content-Range
headers plus no caching headers. This works ok in latest Safari instead, but it does not in Chrome.
While when streaming the full audio file with HTTP 200
, my headers were
{ 'Content-Length': 4724126,
'Content-Type': 'audio/mpeg',
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'POST, GET, OPTIONS',
'Access-Control-Allow-Headers': 'POST, GET, OPTIONS',
Expires: 0,
Pragma: 'no-cache',
'Cache-Control': 'no-cache, no-store, must-revalidate' }
and it works on both Chrome and Safari <audio>
tag.
When streaming partial contents with HTTP 206 the headers were
{ 'Content-Length': 4724126,
'Content-Type': 'audio/mpeg',
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'POST, GET, OPTIONS',
'Access-Control-Allow-Headers': 'POST, GET, OPTIONS',
Expires: 0,
Pragma: 'no-cache',
'Cache-Control': 'no-cache, no-store, must-revalidate',
'Accept-Ranges': 'bytes',
'Content-Range': 'bytes 120515-240260/4724126' }
This led to an error of the Chrome page where the <audio>
or <video>
tag was.
Even the embedded media tag created by Chrome when using the streaming url right in the browser it is not working, and led to this
HTTP/1.1 206 Partial content Date: Wed, 15 Nov 1995 06:25:24 GMT Last-Modified: Wed, 15 Nov 1995 04:58:08 GMT Content-Range: bytes 21010-47021/47022 Content-Length: 26012 Content-Type: image/gif
Hi,I'm not sure what exactly is going wrong in your case, but the Content-Length header in your example looks wrong to me. I'd expect it to be 120515 (i.e. 240260 + 1 - 120515) since that is how many bytes the range represents and how many bytes should be in the response body. Take a look at the Content-Range example in the HTTP spec for another data point on what the Content-Length should be in a range request.Aaron
--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/7f22b449-2c65-4261-aba1-aa5861c1ac20%40chromium.org.
{ 'Content-Length': 119746,
'Content-Type': 'audio/mpeg',
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'POST, GET, OPTIONS',
'Access-Control-Allow-Headers': 'Range',
Expires: 0,
Pragma: 'no-cache',
'Cache-Control': 'no-cache, no-store, must-revalidate',
'Accept-Ranges': 'bytes',
'Content-Range': 'bytes 120515-240260/4724126' }
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/5508b3a2-6fee-4fe4-949e-4954c5be79c0%40chromium.org.
--