Nanobots Protecting Microbots
    Wondering what’s next for npm?Check out our public roadmap! »

    dat-shaka-player-plugin

    0.1.4 • Public • Published

    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

    Install

    npm i dat-shaka-player-plugin

    DownloadsWeekly Downloads

    0

    Version

    0.1.4

    License

    MIT

    Unpacked Size

    7.79 kB

    Total Files

    4

    Last publish

    Collaborators

    • avatar