webtorrent / instant.io

🚀 Streaming file transfer over WebTorrent (torrents on the web)
https://instant.io
MIT License
3.41k stars 433 forks source link

embedded STL viewer #83

Open kigerpunk opened 8 years ago

kigerpunk commented 8 years ago

GitHub uses one, though I can’t find the source. Would it be difficult to add one?

kigerpunk commented 8 years ago

I found one here. That might make it a bit more viable.

feross commented 8 years ago

@ke7ofi Neat idea!

Right now, the code that handles embedding different types of media lives in the webtorrent package at lib/append-to.js. I think that putting STL support there might drastically increase the size of the currently small webtorrent js bundle.

But adding it to instant.io is a great idea! I couldn't see any source code for ViewSTL at your link and we don't want to just iframe a third party service. That's not secure or private, and they don't even support SSL so there would be mixed content errors. We need something that's open source that we can include.

feross commented 8 years ago

@maxogden has an old package that might work, or make a good starting point: https://www.npmjs.com/package/stl-obj-viewer

max-mapper commented 8 years ago

demo http://maxogden.github.io/stl-obj-viewer/

On Fri, Aug 28, 2015 at 11:25 AM, Feross Aboukhadijeh < notifications@github.com> wrote:

@maxogden https://github.com/maxogden has an old package that might work, or make a good starting point: https://www.npmjs.com/package/stl-obj-viewer

— Reply to this email directly or view it on GitHub https://github.com/feross/instant.io/issues/83#issuecomment-135853756.

kigerpunk commented 8 years ago

@feross Is there any way of telling append-to.js to “pipe” it to some other program, or does it have to be fairly integrated? This seems like a case where the Unix approach would be better in the long term as you add more filetypes.

feross commented 8 years ago

@maxogden nice!

feross commented 8 years ago

@ke7ofi Yes, there's already an API to pipe files to arbitrary destinations. See file.createReadStream(), which returns a node.js readable stream which you can pipe to any writable stream, or process by listening to 'data' events.

For the most common case of appending video, audio, or images to the DOM, I think it's nice to have built-in support for now. But we should eventually publish it as a separate npm package and maybe remove support from core to keep it lean and simple...

And there should be a way to extend what file formats file.appendTo() supports so that each WebTorrent user can support whatever formats make sense for them.