Loreto Parisi
2018-11-12 10:16:35 UTC
0down votefavorite
<https://stackoverflow.com/questions/53259737/content-range-working-in-safari-but-not-in-chrome#>
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
[image: Schermata 2018-11-12 alle 10.49.20.png]
I have posted the server code here:
https://stackoverflow.com/questions/53226595/streaming-audio-in-node-js-with-content-range
<https://stackoverflow.com/questions/53259737/content-range-working-in-safari-but-not-in-chrome#>
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
[image: Schermata 2018-11-12 alle 10.49.20.png]
I have posted the server code here:
https://stackoverflow.com/questions/53226595/streaming-audio-in-node-js-with-content-range
--
--
Chromium Developers mailing list: chromium-***@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 unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev+***@chromium.org.
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.
--
Chromium Developers mailing list: chromium-***@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 unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev+***@chromium.org.
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.