Bug 1474543 (WritableStream)

Implement WritableStream

NEW
Assigned to

Status

()

enhancement
P2
normal
Last year
Last month

People

(Reporter: jya, Assigned: jorendorff)

Tracking

(Blocks 3 bugs, {dev-doc-needed})

Firefox Tracking Flags

(Not tracked)

Details

Reporter

Description

Last year
I found no bug created for this.

This is to track implementation of WritableStream
https://developer.mozilla.org/en-US/docs/Web/API/WritableStream

https://streams.spec.whatwg.org/#ws

It doesn't appear to be supported at this stage, and various media 3rd parties have shown their interest.
Priority: -- → P3
Blocks: 1486949
Assignee

Updated

8 months ago
Component: DOM → JavaScript Engine
Priority: P3 → P2
Assignee

Updated

8 months ago
Alias: WritableStream

Comment 1

7 months ago
At Facebook we've recently shipped improvements to our video players utilizing the full set of Stream APIs, including WritableStream. Currently only users of browsers supporting these APIs get to benefit from the new experience. We would love to be able to ship this to Firefox users too, but are blocked on availability of the WritableStream API.
Assignee

Updated

6 months ago
Blocks: streams-meta
Assignee

Updated

6 months ago
Assignee: nobody → jorendorff

Comment 2

6 months ago

Our use case for this with Peergos is downloading or streaming large encrypted files which are reassembled and decrypted in the browser.

For an example see the following. This opens a 120MB version of Sintel and streams it to a video element. In Chrome this is done 5MiB at a time so it can start much faster than in Firefox where it has to fallback to loading the entire video into RAM and decrypting (the keys are in the url hash fragment) before it can start playing:

https://demo.peergos.net/#pQd8rmrEhBN1XBodCnuhegoEumwDbiFEjkYongNGkhRSAk1anF74Yv4t/pQd8rmrEhBN1PqDwhTEcvK5ezKzQ1UWFPmehpE146BxZpC6vHdrAnmZv/CX9xfVdKF7tPW2LRjz3RvoePmwAsNVsTAkAftgrbqKhW/5Pf7SvvCW9dLjFaQB5GXRHuQ5HZU6cjpkVU7vxzzLtgmPt6ULV9?streaming=true&open=true

This means that currently in Firefox we are limited to loading files that will fit into ram, which means we have to recommend Chrome. We would love to be able to recommend Firefox given our privacy focus.

Updated

4 months ago
Blocks: 1323414
Reporter

Comment 3

4 months ago

(In reply to ianopolous from comment #2)

Our use case for this with Peergos is downloading or streaming large encrypted files which are reassembled and decrypted in the browser.

For an example see the following. This opens a 120MB version of Sintel and streams it to a video element. In Chrome this is done 5MiB at a time so it can start much faster than in Firefox where it has to fallback to loading the entire video into RAM and decrypting (the keys are in the url hash fragment) before it can start playing:

https://demo.peergos.net/#pQd8rmrEhBN1XBodCnuhegoEumwDbiFEjkYongNGkhRSAk1anF74Yv4t/pQd8rmrEhBN1PqDwhTEcvK5ezKzQ1UWFPmehpE146BxZpC6vHdrAnmZv/CX9xfVdKF7tPW2LRjz3RvoePmwAsNVsTAkAftgrbqKhW/5Pf7SvvCW9dLjFaQB5GXRHuQ5HZU6cjpkVU7vxzzLtgmPt6ULV9?streaming=true&open=true

This means that currently in Firefox we are limited to loading files that will fit into ram, which means we have to recommend Chrome. We would love to be able to recommend Firefox given our privacy focus.

I'm curious on why you would need Writeable Stream to do this.

There are lots of Web sites having that exact requirements, none of them using writeable streams.

Comment 4

4 months ago

(In reply to Jean-Yves Avenard [:jya] from comment #3)

(In reply to ianopolous from comment #2)

Our use case for this with Peergos is downloading or streaming large encrypted files which are reassembled and decrypted in the browser.

For an example see the following. This opens a 120MB version of Sintel and streams it to a video element. In Chrome this is done 5MiB at a time so it can start much faster than in Firefox where it has to fallback to loading the entire video into RAM and decrypting (the keys are in the url hash fragment) before it can start playing:

https://demo.peergos.net/#pQd8rmrEhBN1XBodCnuhegoEumwDbiFEjkYongNGkhRSAk1anF74Yv4t/pQd8rmrEhBN1PqDwhTEcvK5ezKzQ1UWFPmehpE146BxZpC6vHdrAnmZv/CX9xfVdKF7tPW2LRjz3RvoePmwAsNVsTAkAftgrbqKhW/5Pf7SvvCW9dLjFaQB5GXRHuQ5HZU6cjpkVU7vxzzLtgmPt6ULV9?streaming=true&open=true

This means that currently in Firefox we are limited to loading files that will fit into ram, which means we have to recommend Chrome. We would love to be able to recommend Firefox given our privacy focus.

I'm curious on why you would need Writeable Stream to do this.

There are lots of Web sites having that exact requirements, none of them using writeable streams.

Can you name one? What technique do they use? The closest I'm aware of is Mega, and they have the exact same problem. In Chrome they solve it with a Chrome specific file system api, and in Firefox they resort to loading it into RAM, as I've suggested, and downloading from a blob.

The general problem is for large files that are generated in the browser to be streamed directly to a host file (or or video tag). We generate them by reassembling fragments and decrypting in the browser with keys that are not exposed to the server.

P.S. N.B. the link I gave longer works - we are in middle of changing some things. I'll post another link when we're done.

Assignee

Updated

3 months ago
Duplicate of this bug: 1530363

Comment 6

2 months ago

As promised, here is an updated link to streaming Sintel using writable streams if they are present. This can start within a few seconds in Chrome, but in Firefox has to wait until the entire 120mb video is downloaded and decrypted (and it may crash if it doesn't fit in ram):

https://demo.peergos.net/#6MDZhRRPT4ugkJuUfcPPhf1US9u7FvRALmj42mJ6e3yDibnLtqfhchE6Frm6Lf/6MDZhRRPT4ugkJuUfcZdxu6JLKyrLBE36Kasxb4jix7An4dbeiekpDF6h2fDBM/G5KGmeQzGbaA16NGXRR6MtzkTw54YABd8wxaYxZKecth/5Pf7SvriCWAvPWM2ubDhCXbFasZFmPTZEyjHLKJKa26tYxCxN1R?open=true

You need to log in before you can comment on or make changes to this bug.