# dat-shaka-player-plugin

> A plugin for 'shaka-player' to load 'dat://' URIs

Latest version **0.1.4** (published 2019-04-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install dat-shaka-player-plugin
pnpm add dat-shaka-player-plugin
yarn add dat-shaka-player-plugin
bun add dat-shaka-player-plugin
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.4 |
| Published | 2019-04-29 |
| First published | 2019-04-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 7 |
| Unpacked size | 7.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Joseph Werle |
| Maintainers | werle |
| Keywords | dat, shaka, player, plugin |

## Links

- npm: https://www.npmjs.com/package/dat-shaka-player-plugin
- npm.io page: https://npm.io/package/dat-shaka-player-plugin

## Dependencies (7)

- [mime](https://npm.io/package/mime.md) ^2.4.2
- [debug](https://npm.io/package/debug.md) ^4.1.1
- [hyperdrive](https://npm.io/package/hyperdrive.md) ^9.14.5
- [range-parser](https://npm.io/package/range-parser.md) ^1.2.0
- [collect-stream](https://npm.io/package/collect-stream.md) ^1.2.1
- [dat-link-resolve](https://npm.io/package/dat-link-resolve.md) ^2.3.0
- [random-access-memory](https://npm.io/package/random-access-memory.md) ^3.1.1

## Alternatives

- [@regle/core](https://npm.io/package/@regle/core.md) — 47.0K weekly downloads
- [typeof-arguments](https://npm.io/package/typeof-arguments.md) — 12.5K weekly downloads
- [@lokalise/projects-engine-contracts](https://npm.io/package/@lokalise/projects-engine-contracts.md) — 978 weekly downloads
- [@osjwnpm/nam-laboriosam-quibusdam](https://npm.io/package/@osjwnpm/nam-laboriosam-quibusdam.md) — 70 weekly downloads
- [@oridune/validator](https://npm.io/package/@oridune/validator.md) — 16 weekly downloads

## Recent versions

- 0.1.4 (latest) — 2019-04-29
- 0.1.3 — 2019-04-29
- 0.1.1 — 2019-04-29

## README

dat-shaka-player-plugin
================

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

## Installation

```sh
$ npm install dat-shaka-player-plugin
```

## Usage

```js
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:

```js
{
  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

---
_Source: https://npm.io/package/dat-shaka-player-plugin · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
