Comments (4)
Funny, just thought: "we already have FileReader, why not FileWriter?"
var writer = new FileWriter('filename')
writer.readAsBlob(blob)
writer.readAsSocket(new WebSocket)
writer.readAsStream(audioStream)
Maybe cuz it's a bad idéa and we have to support all of them.
perhaps just better to enforce a stream and build other function around that
How about:
var writer = new FileWriter(stream, 'filename')
// writer.methods? writer.close()
still think you should close it using the streams close method instead...
but then again, you maybe want to keep recording the camera without closing the the stream how do you then stop the writer?
let writeStream = createWriteStream("filename")
stream.pipeTo( writeStream )
writeStream.close()
// stream is still alive
from streamsaver.js.
One thing that i have experience when using this for a little while now with this syntax
saveStream(stream, "filename")
Is that: if you want to close the stream-saver you would need to close the stream you are trying to save...
I believe it's undesirable?
For example: I want to show a <video>
tag what it looks like. But don't want to start recording until user press the record button. When I want to stop writing to the filesystem then I don't want to stop the <video>
tag. I still want to show a preview of what it looks like.
I'm leaning more towards creating a createWriteStream('filename')
that way when you close the writer it will stop saving to the disk, and if you close the mediaStream it will signal to the writer (if you have piped it) that it should also close
from streamsaver.js.
@eligrey and everyone else do you have some spare time to look at the difference?
I have experience with both
saveStream(stream, "filename")
And also this: (checkout the Writable branch)
var myFile = fs.createWriteStream("filename")
myFile.write("abc")
// you could also do this:
let stream = fs.createBlobReader(blob)
stream.pipeTo(myFile)
What do you think is best?
from streamsaver.js.
I know now what i want...
from streamsaver.js.
Related Issues (20)
- When will the new version of Streamsaver be released? HOT 2
- check integrity of downloaded files
- mitm page ends in 404 HOT 1
- Not compatable with download manager extensions HOT 4
- Incomplete download when writing a file in chunks HOT 5
- File cannot be loaded with unsecured connection, when serviceWorker does not exist
- How can I merge the generated docx into a zip?
- Why is the data always 0 when I add files like this? My binary is sure to have data
- Why my memory usage blow up after stopping a download?
- There is something wrong with the file saved in firefox.
- Iframes are not removed from the DOM after a file is downloaded HOT 1
- The browser will crash when downloading files exceeding 2G through fetch HOT 4
- Why is a call being made to an external site at all? HOT 1
- invalid error: [StreamSaver] You didn't send a messageChannel HOT 2
- Incomplete download when write to the streamSaver HOT 1
- Service worker cuts out immediately when network connection is interrupted in FF
- Do I need to use mitm?
- How Do I Modify sw.js to Avoid SSL Certificate Verification? HOT 1
- Turbo rails, secure context: TypeError: Cannot read properties of null (reading 'postMessage') in iframe postMessage handler
- Websocket download not work in firefox HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from streamsaver.js.