Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose method to return seekInfo metadata (whilst not seeking) #364

Open
Secretmapper opened this issue Sep 22, 2023 · 0 comments
Open

Expose method to return seekInfo metadata (whilst not seeking) #364

Secretmapper opened this issue Sep 22, 2023 · 0 comments

Comments

@Secretmapper
Copy link

Secretmapper commented Sep 22, 2023

Usecase: Imagine if a dev wanted to download and play the first 10 seconds of an mp4. They can parse the moov box, seek(0) and seek(10) to get the byte range, and append the buffers from that info.

However, there's a couple of problems with this:

  • seek seeks the file. This can be problematic when introspecting on a file that's playing.
  • seek returns the latest bytes to be appended.
    • This is a pretty big one. The seekInfo returned can choose not to correspond to the time being requested, but the 'last known byte' that needs to be appended. (If the first 15 seconds have been downloaded, the byteOffset returned is for the 15th second).

Proposed Solution: Have a method, say offsetForSecond, which would return the byteOffset for a specific timestamp in the file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant