1.0.0 • Published 3 years ago

@konsumi/adaptive-torrentvideo v1.0.0

Weekly downloads
-
License
BSD-4-Clause-Shor...
Repository
-
Last release
3 years ago

adaptive-torrentvideo

A configurable package to apply bitwise adaptive loading to torrent videos on a web based javascript client. Based on webtorrent.

install

npm install adaptive-torrentvideo

Then create a plugin.

import AdaptiveTorrentvideo from 'adaptive-torrentvideo';
Vue.use(AdaptiveTorrentvideo)

usage

You can use it as a directive in any component you like by importing it and passing the your torrent which you want to stream:

<template>
  <video controls width="729" height="370" v-torrentvideo="{ 
    link: torrentLink,
    filepath: 'demo.mp4',
    quality: SD540p
  }"></video>
</template>

<script lang="ts">
import { Component, Vue } from 'nuxt-property-decorator';

@Component
export default class ClassApi extends Vue {
  torrentLink: string;

  data() {
    return {
      torrentLink: 'https://webtorrent.io/torrents/sintel.torrent'
    }
  }
}
</script>

options

The plugin also takes some options on install.

Vue.use(AdaptiveTorrentvideo, { defaultTorrentLink: 'https://any-default.com/torrent' })
  • defaultTorrentLink: can be added to immediately after initializing loading the given torrent link or magnet link

license

BSD-3-Clause

Copyright (c) 2021 - Konsumi