# web-monetized-video

> A web monetized video component.

Latest version **0.1.7** (published 2020-06-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install web-monetized-video
pnpm add web-monetized-video
yarn add web-monetized-video
bun add web-monetized-video
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.7 |
| Published | 2020-06-28 |
| First published | 2020-05-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 17 |
| Author | Jasmin Virdi |
| Maintainers | jasmin_virdi |
| Keywords | web monetization, video, player, web component, custom element |

## Links

- npm: https://www.npmjs.com/package/web-monetized-video
- Repository: https://github.com/Jasmin2895/web-monetized-video
- Homepage: https://github.com/Jasmin2895/web-monetized-video#readme
- Issues: https://github.com/Jasmin2895/web-monetized-video/issues
- npm.io page: https://npm.io/package/web-monetized-video

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 0.1.7 (latest) — 2020-06-28
- 0.1.5 — 2020-06-14
- 0.1.4 — 2020-06-04
- 0.1.3 — 2020-06-02
- 0.1.2 — 2020-05-31
- 0.1.1 — 2020-05-28
- 0.1.0 — 2020-05-25
- 0.0.4 — 2020-05-25
- 0.0.3 — 2020-05-24
- 0.0.2 — 2020-05-24
- 0.0.1 — 2020-05-24
- 0.0.7 — 2020-05-24

## README

# web-monetized-video
A web component with has play and pay policy. This component charges you for the amount of video you have watched. :smile: :dancer:

## Component:
* [`<web-monetized-video>`] - a component that allow the user to pay for the section of video watched.

## Installation
`<web-monetized-video>` is a packaged javascript module.
> Modules are loaded asynchronulsy by browser, so for registering our component quickly we can load them in the head :thumbsup:

```html
<head>
  <script type="module" src="https://unpkg.com/web-monetized-video"></script>
</head>
```

## How to use
```html
<html>
<head>
  <script type="module" src="https://unpkg.com/web-monetized-video"></script>
</head>
<body>

  <web-monetized-video width="300" height="200" url="video_url" monetization-link="payment_pointer"></web-monetized-video>

</body>
</html>
```

### Parameters
* `width` - Width of the element
* `height` - Height of the element
* `url`- Link of the video. (Example- `https://www.html5rocks.com/en/tutorials/video/basics/Chrome_ImF.webm`)
* `monetization-link`- payment wallet of the user (Example- `$wallet.example.com/alice`)

### Events Listeners
| Events        | Are           |
| ------------- |:-------------:| 
| `monetizationstart`      | Determine when Web Monetization has started actively paying by adding an event listener for monetizationstart  |
| `monetizationprogress`      | Determine the current status of the payment stream by adding an event listener for monetizationprogress |
| `monetizationpending` |Determine when Web Monetization is enabled by adding an event listener for monetizationpending |
| `monetizationstop` | Determine when Web Monetization has stopped by adding an event listener for monetizationstop |


### Adding to your app via `npm`

```bash
npm install web-monetized-video --save
```

Include in your app javascript (e.g. src/App.js)
```js
import 'web-monetized-video';
```
This will register the custom elements with the browser so they can be used as HTML.

## LICENSE

MIT (c) 2020 Jasmin Virdi

---
_Source: https://npm.io/package/web-monetized-video · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
