Comments (3)
So I get these info with ffprobe
like
ffprobe -i /root/audio/12380187.mp3 -show_frames -show_entries frame=pkt_pos -of default=noprint_wrappers=1:nokey=1 -hide_banner -loglevel panic -read_intervals 20%+#1
480279
where 20
is my start position in seconds that turns out to be 480279
in bytes.
In this way I have passed the header like bytes=120515-240260
and I get a range array of
[ 120515, 240260, 4724126 ]
where the last bytes is of course the file length. Having this settings I have these headers
:
{
"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",
"Accept-Ranges": "bytes",
"Content-Range": "bytes 120515-240260/4724126"
}
Problem is that it does not work then i.e. it does not stream any contents so what is wrong here?
from mediaserver.
[UPDATE]
I think this maybe due to a severe issue on Google's Chrome so I have asked to SF in Content-Range working in Safari but not in Chrome and in Streaming audio in Node.js with Content-Range.
My latest attempt was using the suggested Access-Control-Allow-Headers
header set to Range
{ 'Content-Length': 5751405,
'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 120429-240237/5751405' }
as referred in mozilla/pdf.js#3150 and in mozilla/pdf.js#4530 (comment)
from mediaserver.
Thanks for the update. Closing it for now then.
from mediaserver.
Related Issues (11)
- Origin is not allowed by Access-Control-Allow-Origin HOT 6
- Transcode HOT 3
- Can't play webm files
- Node js crashes when i am trying to play.
- mp3 files continue past time HOT 1
- cannot start server HOT 1
- not working in chrome HOT 1
- Start Stream at specific point of time of mp3 ? HOT 2
- Website referenced doesn't exist: http://www.webmaster-toolkit.com/mime-types.shtml HOT 1
- Example doesn't work on Desktop and Mobile Safari HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mediaserver.