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

Examples not work? #301

Closed
brunocascio opened this issue Apr 23, 2015 · 2 comments
Closed

Examples not work? #301

brunocascio opened this issue Apr 23, 2015 · 2 comments

Comments

@brunocascio
Copy link

@brunocascio brunocascio commented Apr 23, 2015

I tried to use stream video example:

var WebTorrent = require('webtorrent')

var client = new WebTorrent()
var magnetUri = 'magnet:?xt=urn:btih:d2474e86c95b19b8bcfdb92bc12c9d44667cfa36'

client.add(magnetUri, 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)
})

but callback never execute. What's wrong?

@feross

This comment has been minimized.

@feross feross closed this Apr 24, 2015
@brunocascio

This comment has been minimized.

Copy link
Author

@brunocascio brunocascio commented Apr 24, 2015

Thanks!

@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.