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

info required #955

Closed
rafaelleru opened this issue Oct 21, 2016 · 2 comments
Closed

info required #955

rafaelleru opened this issue Oct 21, 2016 · 2 comments

Comments

@rafaelleru
Copy link

@rafaelleru rafaelleru commented Oct 21, 2016

where I can find information about play a stream created by:

stream = file.createReadStream([opts])

I want to play this stream directly into my player, to download files faster.

@feross

This comment has been minimized.

Copy link
Member

@feross feross commented Jan 17, 2017

file.createReadStream() returns a node.js Readable stream. Documentation available here: https://nodejs.org/api/stream.html#stream_readable_streams

This returns the raw video data. It's not going to be easy to pipe that straight into a video player. That's why we created the file.renderTo() and file.appendTo() methods. There's a lot of work required to process the video file into a format that can be streamed into the video tag (using the MediaSource API, which has very strict requirements about the packaging of the video).

Handling seeking is also a difficult challenge – you have to translate the time that the user seeked to (in seconds) into a byte offset into the file. This requires parsing the MP4 metadata to understand the file structure.

All this magic is currently handed in the render-media and videostream packages.

@feross feross closed this Jan 17, 2017
@lock

This comment has been minimized.

Copy link

@lock lock bot commented May 4, 2018

This thread has been automatically locked because it has not had recent activity. To discuss futher, please open a new issue.

@lock lock bot locked as resolved and limited conversation to collaborators May 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.