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

Streaming Hybrid to Browser stuck after a few seconds #1079

Closed
kocoten1992 opened this issue Mar 17, 2017 · 6 comments
Closed

Streaming Hybrid to Browser stuck after a few seconds #1079

kocoten1992 opened this issue Mar 17, 2017 · 6 comments

Comments

@kocoten1992
Copy link
Contributor

@kocoten1992 kocoten1992 commented Mar 17, 2017

What version of WebTorrent?
0.98.13

What operating system and Node.js version?
Ubuntu 17.04, node v7.3.0

What browser and version? (if using WebTorrent in the browser)
chrome 57.0

What did you expect to happen?
Smooth continuously streaming from nodejs to browser, both are connect to tracker.

What actually happened?
Streaming only work for a little (about 2-5 MB) at the beginning, then differently behave depend on the environment.

Setup 1: tracker - nodejs seeder - browser as peer

  1. On terminal 1st, I use https://github.com/feross/bittorrent-tracker, and run the command
node_modules/.bin/bittorrent-tracker --http-hostname 0.0.0.0 --http --udp --ws --udp-hostname 0.0.0.0 --port 6881
  1. On terminal 2nd, use https://github.com/feross/webtorrent-hybrid, the command as follow
node_modules/.bin/webtorrent-hybrid seed data/my_movie.mp4 --announce 'ws://example.com:6881/announce'
  1. On the browser (let call 3rd), here are the code:
var client = new WebTorrent // https://github.com/feross/webtorrent

var torrentId = 'magnet:?id=2&xt=urn:btih:e8147c928b708b741308d21ead985a3a49342dad'

client.add(torrentId, {
    announce: ['ws://example.com:6881/announce']
  },
  function (torrent) {
    var file = torrent.files[0]
    console.log(torrent.infoHash)
    file.appendTo('body')
  })

On 2nd, it will only seed for 2 -> 6 MB at the beginning and then stop.
On browser (3rd), if I'm lucky with 2nd seed more than 3 MB, it will play the movie for a few second and then stop, after this point the whole thing stall forever (or at least 30 min without any progress).
On 2nd, it not recognize there is a browser peer anymore Running time: 38 minutes Time remaining: N/A Peers: 0/0

Setup 2: tracker - nodejs seeder - nodejs peer

  1. same as Setup 1
  2. same as Setup 1
  3. Let call this 3rd, use https://github.com/feross/webtorrent-hybrid, and run the following command:
node_modules/.bin/webtorrent-hybrid download e8147c928b708b741308d21ead985a3a49342dad --announce 'ws://example.com:6881/announce'

It will first download some big amount 40-200 MB at the beginning and then stop.
But on both terminal webtorrent hybrid, it not losing connection of each other Running time: an hour Time remaining: N/A Peers: 1/1
After sometimes (about 5 min or what?) it continue download for 40-200 MB and stop, and keep repeating that until finish (But I should expect it to continuously download to the end?)
About the speed, it get around 3.5 - 4 MB / seconds, but this experiment are on the same computer, it should be as fast as hard drive - 70 MB or more?

Conclusion

I did again with some many more complex test, conclusion:
Hybrid can keep up connection, after sometimes they heal (but they should work perfectly without pause)
When a new hybrid connect to the swarm it kick browser currently connect to swarm for a little more and then stop (they dump each other and keep no contact no more).

*EDIT: on setup 1, if wait for more than an hour, movie on browser does proceed (at super slow speed)

@kocoten1992

This comment has been minimized.

Copy link
Contributor Author

@kocoten1992 kocoten1992 commented Mar 17, 2017

On setup 1, I can confirm if you wait long enough, it will eventually proceed, any possible this belongs to tracker false?

@zephrax

This comment has been minimized.

Copy link

@zephrax zephrax commented May 2, 2017

It's happening the same to me. Why does it works this way? Did you find a solution?

@L11R

This comment has been minimized.

Copy link

@L11R L11R commented Jul 20, 2017

Same problem. Opened issue here webtorrent/webtorrent-hybrid#68

@kocoten1992

This comment has been minimized.

Copy link
Contributor Author

@kocoten1992 kocoten1992 commented Jul 20, 2017

hope this problem not belong to electron-webrtc in hybrid, cause there no alternative as the moment, and it suck webtorrent/webtorrent-hybrid#64

@L11R

This comment has been minimized.

Copy link

@L11R L11R commented Jul 20, 2017

It seems like all developers are resting :D

@feross

This comment has been minimized.

Copy link
Member

@feross feross commented Apr 26, 2018

Please continue discussion of this issue here: webtorrent/webtorrent-hybrid#76

@feross feross closed this Apr 26, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Jul 25, 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
4 participants
You can’t perform that action at this time.