Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign uprecompose readStream and play it afer sending via ipc #971
Comments
This comment has been minimized.
This comment has been minimized.
|
You can use the render-media package to convert the stream into an audio/video element. That's what webtorrent uses for the file.appendTo and file.renderTo methods. Alternatively, it may just be easier to run webtorrent in the browser side of electron, not the nodejs side, but depending on your use case this may not be an option. Hope this helps! |
This comment has been minimized.
This comment has been minimized.
|
I just show your response and it's sound good but can you hel me a bit more with the recompose of the stream. I can not find any information about load the incomming chunk into a new stream on the renderer side. |
This comment has been minimized.
This comment has been minimized.
|
@rafaelleru I'm not too familiar with streams, but it seems like you'll have to create a Readable stream on the render side, and when you receive the ipc data, send the data to the stream with |
This comment has been minimized.
This comment has been minimized.
|
I'm still having problems with this because in the file object creation I can't make the render method to works. I'm trying to set the createReadableStream property to my stream of data, that I receibe from ipc but it gives me an excepcion that says it's undefined. My code looks like:
and vars are initialized in the begining of the jd file. @xuset any help with this¿ |
This comment has been minimized.
This comment has been minimized.
|
@rafaelleru I think the best way for you to accomplish what you're trying to do is to use |
This comment has been minimized.
This comment has been minimized.
|
This thread has been automatically locked because it has not had recent activity. To discuss futher, please open a new issue. |
If I send every data of file as readStream throught ipc message, how I can play this data into client side of electron (the renderer procces reading this data from the live stream). I'm sending data like this:
readstream = file.createReadStream(); readstream.on('data', function(chunk){ ipc.send('play', data); }so in the renderer I have a constant flow of data that I don't know how to recompose. Whats the better form for do this?