GithubHelp home page GithubHelp logo

start and end time about mediaserver HOT 3 CLOSED

obastemur avatar obastemur commented on August 29, 2024
start and end time

from mediaserver.

Comments (3)

loretoparisi avatar loretoparisi commented on August 29, 2024

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.

loretoparisi avatar loretoparisi commented on August 29, 2024

[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.

obastemur avatar obastemur commented on August 29, 2024

Thanks for the update. Closing it for now then.

from mediaserver.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.