@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@0.98.18
<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@0.98.18/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://cdn.jsdelivr.net/gh/shiyiya/QI-ABSL@master/o/poster.png'
    }
  })
    .use([OTorrent()])
    .create()
</script>