如何使用torrent磁力链接作为视频嵌入链接并使用它在网站上显示视频?

I want to use <video src="torrent link"> as <video src="youtube link">. Is it possible?

I tried normally by making torrent links & directly showing on the page. But got errors.

Here I can embed any link from any website & it works. So same thing I want to use on torrents to get video data & play on website. It will help us to make a website better

All videos are playing. Here you can upload from hard drive & from any website also.

dongshetao1814
dongshetao1814 您需要一个知道如何流式传输视频的torrent客户端,大多数浏览器都没有内置(如果有的话)。
接近 3 年之前 回复
dozpox8752
dozpox8752 好吧,我会给我一些时间
接近 3 年之前 回复
dsft8327
dsft8327 我想你将不得不解释更多你想要的东西,你尝试过的东西以及你得到的错误。基本上为我们提供了一个最小,完整和可验证的示例。事实上,很难回答你的问题。
接近 3 年之前 回复

2个回答

Of course you can simply use https://webtorrent.io

Working example:

var WebTorrent = require('webtorrent')

var client = new WebTorrent()

// Sintel, a free, Creative Commons movie
var torrentId = 'magnet:?xt=urn:btih:08ada5a7a6183aae1e09d831df6748d566095a10&dn=Sintel&tr=udp%3A%2F%2Fexplodie.org%3A6969&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969&tr=udp%3A%2F%2Ftracker.empire-js.us%3A1337&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337&tr=wss%3A%2F%2Ftracker.btorrent.xyz&tr=wss%3A%2F%2Ftracker.fastcast.nz&tr=wss%3A%2F%2Ftracker.openwebtorrent.com&ws=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2F&xs=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2Fsintel.torrent'

client.add(torrentId, function (torrent) {
  // Torrents can contain many files. Let's use the .mp4 file
  var file = torrent.files.find(function (file) {
    return file.name.endsWith('.mp4')
  })

  // Display the file by adding it to the DOM.
  // Supports video, audio, image files, and more!
  file.appendTo('body')
})



这是可能的,但据我所知,它无法使用常规方法(HTML / Javascript / PHP)完成。 我所知道的唯一方法是使用Java applet。 虽然它确实有效,但它并不是那么有效,取决于你打算用它做什么。 无论如何,Bitlet得到了这个工作。 他们成功地用Java实现了Bittorrent协议。 您可以在 Github这里查看他们的代码。 </ p>
</ div>

展开原文

原文

It is possible, but as far as I know, it can't be done using regular means (HTML/Javascript/PHP). The only way I know of is to use Java applet. Though it does work, it isn't really that efficient, depending on what you intend to do with it. Anyways, Bitlet got this working. They succeed in implementing the Bittorrent protocol in Java. You can check their code on Github here.

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐