@oplayer/torrent

oplayer-plugin-torrent

npm (opens in a new tab) npm bundle size npm dm (opens in a new tab) jsdelivr (opens in a new tab)

WebTorrent (opens in a new tab) plugin for oplayer

Install

npm i @oplayer/core @oplayer/torrent webtorrent
<script src="https://cdn.jsdelivr.net/npm/@oplayer/core@latest/dist/index.min.js"></script>
<!--  webtorrent FIRST  -->
<script src="https://cdn.jsdelivr.net/npm/webtorrent@latest/webtorrent.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@oplayer/torrent@latest/dist/index.min.js"></script>
 
<div id="oplayer" />
 
<script>
  OPlayer.make('#oplayer', {
    source: {
      src: 'http://example.com/live/livestream.ts',
      poster: 'https://oplayer.vercel.app/poster.png'
    }
  })
    .use([OTorrent()])
    .create()
</script>