javascripthtmlnpmwebtorrent

Webtorrent error Uncaught Error: Can only pipe to one destination


I was expecting it to stream video from given torrent file and because it's provided as example on their official site, I expected it to work.

I tried creating default site (code provided here) to see if everything is set up correctly, but i got errors

Uncaught Error: Can only pipe to one destination
at ReadableState.pipe (webtorrent.min.js:16:173759)
at module.exports.pipe (webtorrent.min.js:16:179641)
at webtorrent.min.js:16:216698
at Array.forEach ()
at MP4Remuxer.seek (webtorrent.min.js:16:216602)
at VideoStream._pump (webtorrent.min.js:16:220728)
at VideoStream.VideoStream._onWaiting (webtorrent.min.js:16:219710)

.

webtorrent.min.js:16 GET https://webtorrent.io/torrents/Sintel/Sintel.mp4 net::ERR_CACHE_OPERATION_NOT_SUPPORTED
Client

and

WebSocket connection to 'wss://tracker.fastcast.nz/' failed: webtorrent.min.js:16 

I tried searching this question online but there sems to be no useful information. Did I screw something up or is something wrong with webtorrent?

Basic info: OS: Win11 Node.js: v18.16.0 npm: 9.5.1 webtorrent: 2.0.16

Thanks for help!


Solution

  • I hade the same issue. I solved it by switching to an older version. Try: https://cdn.jsdelivr.net/npm/webtorrent@1.8.0/webtorrent.min.js

    I also created a small working demo app with nextjs, repo: https://github.com/Joel-Adving/web-torrent-streamer