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 upStreaming MP4 from browser with webtorrent min js & seeding from instant.io on a server{Code Help}{Bounty} #420
Comments
This comment has been minimized.
This comment has been minimized.
|
Got it work now, trying to install the seed-server with command line and webtorrent-hybrid but got a bunch of node errors and install fails. Digging into it. Code of the client page look like that now : <html lang="en">
<head>
<meta charset="utf-8">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="//awsdrp.net/QXT/webtorrent.min.js"></script>
<script src="//awsdrp.net/9sx/concat-stream-1.4.7"></script>
</head>
<body>
<script>
// var WebTorrent = require('webtorrent')
var client = new WebTorrent()
var magnetUri = 'magnet:?xxxxxxxtracker.webtorrent.io'
client.add(magnetUri, function (torrent) {
// Got torrent metadata!
console.log('Client is downloading:', torrent.infoHash)
torrent.files.forEach(function (file) {
// Display the file by appending it to the DOM. Supports video, audio, images, and
// more. Specify a container element (CSS selector or reference to DOM node).
file.appendTo('body')
})
})
</script>
</body>
</html>-1/ The video file is played by the 'regular' player (html5 player of the browser), i would like to parse the video source to use it in FlowPlayer or another HTML5 Player with mores options, how i can put the video file source into a variable ? -2/ How i can seed the file also, using client.seed(files, function onTorrent (torrent) {
console.log('Client is seeding:', torrent.infoHash)
})Got me bunch of error like the variable is not found etc, i would like to seed the file i'am downloading too, to share/save bandwidth. Would appreciate any help, willing to donate/bounty 30/40$ for quick issue resolving. |
This comment has been minimized.
This comment has been minimized.
|
Hi @Daemon024, I'm still trying to figure out how to get the blob url as soon as the video is loaded. I would like to know this too so when I figure it out I will let you know. You can seed the video from a http webseed like this:
You will have to compile this code with browserify and have a web server hosting the files (like this for example http://fastcast.nz/downloads/cityscape-chicago-ii.mp4). You can manually create a torrent file with a webseed by adding &ws= onto the end of the magnetic link you want, for example Then paste the magnet link on https://instant.io/ while a webrtc peer is seeding, and download the torrent file. You will then have to upload the torrent file to your web server and define the torrentName (and the path before it like I have done). You might find it useful to have a look at my project https://github.com/fastcast/fastcast. Good luck and let me know how it goes! |
This comment has been minimized.
This comment has been minimized.
|
Hi |
This comment has been minimized.
This comment has been minimized.
You can't get the blob url until the file you want is fully downloaded, because unfortunately |
This comment has been minimized.
This comment has been minimized.
This depends on exactly how FlowPlayer works, and I'm not familiar with the details. But you can now tell WebTorrent to render it's video into an existing If you can get FlowPlayer to make a video element without an actual video source, then you can get a reference to the var videoElem = document.querySelector('video') // probably want to make sure this is actually the right video tag
file.appendTo(videoElem, function (err, elem) {
// done!
}) |
This comment has been minimized.
This comment has been minimized.
|
This comment has been minimized.
This comment has been minimized.
|
This thread has been automatically locked because it has not had recent activity. To discuss futher, please open a new issue. |
Hi
I'am trying to setup a server who will share torrents videos files, and a web-player page for clients, who need to play this video file over web torrent library and seed the file to, to share the bandwith.
Actually i have the server seeding over Instant.io
and my client page code look like this
But actually i have multiples issues :
-1/ I dont know how i can script this to seed the torrent to, my goal is to have the 'viewers' to 'seed' after downloading/while downloading
-2/ The player dont work, i have some odd error in console :
If i host the client page on the same server :
*If the client page is in local (MAMP), i do have a player opening, but cant load the video : *