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

createObjectURL with ReadableStream #189

Closed
Zipdox2 opened this issue Jan 19, 2023 · 2 comments
Closed

createObjectURL with ReadableStream #189

Zipdox2 opened this issue Jan 19, 2023 · 2 comments

Comments

@Zipdox2
Copy link

Zipdox2 commented Jan 19, 2023

I believe allowing the creation of object URLs for ReadableStreams would be very useful. Especially since some browsers don't implement the File System Access API for security.

Creating object URLs for ReadableStreams would allow for example progressive downloads of large client generates files. Currently doing this requires a hack using service workers, but these are not usable in private mode.

It could also be used to progressively load images from a stream this way, although maybe this is less practical to implemented and less useful.

It probably isn't that useful to play videos from streams like this as the MediaSource object already exists for that.

Implementing object URLs for streams might be more difficult than for static objects, but it was done for MediaSource before, so it should be possible in a similar fashion. I propose that creating an object URL for a stream locks the stream in the same way creating a reader does.

@saschanaz
Copy link
Member

createObjectURL itself is not recommended as it's leaky, probably we should get a proper download API that receives Response object: whatwg/html#4148. For other use cases, see whatwg/fetch#49.

@annevk
Copy link
Member

annevk commented Jan 19, 2023

Closing this as per @saschanaz reply.

@annevk annevk closed this as completed Jan 19, 2023
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

3 participants