@konsumi/adaptive-torrentvideo
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

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

Package Sidebar

Install

npm i @konsumi/adaptive-torrentvideo

Weekly Downloads

1

Version

1.0.0

License

BSD-4-Clause-Shortened

Unpacked Size

9.27 kB

Total Files

7

Last publish

Collaborators