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 up<video> tag streaming #144
Comments
This comment has been minimized.
This comment has been minimized.
|
For those who want to play around with this without waiting, it's already implemented here: https://github.com/feross/webrtc-whiteboard/blob/master/client/index.js#L287 for webrtc-whiteboard. |
This comment has been minimized.
This comment has been minimized.
|
This is implemented now. Stream into a video tag like this: var WebTorrent = require('webtorrent')
var client = new WebTorrent()
client.download(magnet_uri, function (torrent) {
// Got torrent metadata!
console.log('Torrent info hash:', torrent.infoHash)
// Let's say the first file is a webm (vp8) or mp4 (h264) video...
var file = torrent.files[0]
// Create a video element
var video = document.createElement('video')
video.controls = true
document.body.appendChild(video)
// Stream the video into the video tag
file.createReadStream().pipe(video)
}) |
This comment has been minimized.
This comment has been minimized.
|
Published as webtorrent 0.10.0. |
This comment has been minimized.
This comment has been minimized.
|
iw would be good if you add working example of this on instant.io |
This comment has been minimized.
This comment has been minimized.
|
I have. It only works on chrome because firefox has mediasource behind an On Tuesday, October 21, 2014, iShift notifications@github.com wrote:
Feross | blog http://feross.org/ | webtorrent http://webtorrent.io/ | |
This is a primitive - this should be easier to do, preferably built-in.