Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test video streaming exemple #221

Closed
ghislainf opened this issue Dec 28, 2014 · 1 comment
Closed

Test video streaming exemple #221

ghislainf opened this issue Dec 28, 2014 · 1 comment

Comments

@ghislainf
Copy link

@ghislainf ghislainf commented Dec 28, 2014

Hello !

I have test video streaming exemple with browserify, but the callback of client.download was never call. Any idea what's wrong ?

The magnet link works with webtorrent command line

Chrome v39.0.2171.95 (64-bit)
OSX 10.10.1

var WebTorrent = require('webtorrent')

var client = new WebTorrent()
var magnet_uri = "<redacted>"

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)
});
@feross

This comment has been minimized.

Copy link
Member

@feross feross commented Dec 29, 2014

Until mainstream BitTorrent clients support WebTorrent, or we build a client that gains traction, the brower-based webtorrent client can only download from from other browser-based clients. Browsers can't open arbitrary tcp/udp connections -- just WebRTC connections.

The torrent you selected likely has no seeders in the web network.

@feross feross closed this Dec 29, 2014
@lock lock bot locked as resolved and limited conversation to collaborators May 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.