0.1.4 • Published 5 years ago

dat-shaka-player-plugin v0.1.4

Weekly downloads
-
License
MIT
Repository
-
Last release
5 years ago

dat-shaka-player-plugin

A plugin for 'shaka-player' to load dat:// URI schemes.

Installation

$ npm install dat-shaka-player-plugin

Usage

const register = require('dat-shaka-player-plugin')
const shaka = require('shaka-player')

register(shaka)

API

plugin = require('dat-shaka-player-plugin')(shaka, options)

A factory function to create and register the plugin with shaka-player to handle dat:// URI requests for MPEG-DASH manifests (*.mpd) or HLS playlists (*.m3u8). shaka is the shaka-player module and options can be:

{
  archive: Object, // an optional 'hyperdrive' instance that represents a DAT archive. This will override the resolved archive from the DAT link.
  swarm: Object, // an optional 'discovery-swarm-web' or 'discovery-swarm' object to swarm for resources
  discovery: Object, // an optional object passed to the swarm constructor
}

plugin.requests

A Set that represents the currently active requests being made by the shaka-player for resources stored in a DAT archive.

plugin.options

The options passed to the plugin factory.

plugin.swarms

A Map of swarms corresponding to a DAT link.

plugin.drives

A Map of hyperdrives corresponding to a DAT link.

plugin.destroyed

A boolean indicating that the plugin is destroyed.

plugin.unregister()

An alias to plugin.destroy()

plugin.destroy()

Destroy the plugin, close the underlying resources, and unregister as a scheme for shaka-player.

License

MIT