0.1.7 • Published 4 years ago

web-monetized-video v0.1.7

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

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:

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:

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

How to use

<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

EventsAre
monetizationstartDetermine when Web Monetization has started actively paying by adding an event listener for monetizationstart
monetizationprogressDetermine the current status of the payment stream by adding an event listener for monetizationprogress
monetizationpendingDetermine when Web Monetization is enabled by adding an event listener for monetizationpending
monetizationstopDetermine when Web Monetization has stopped by adding an event listener for monetizationstop

Adding to your app via npm

npm install web-monetized-video --save

Include in your app javascript (e.g. src/App.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

0.1.7

4 years ago

0.1.5

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.1

4 years ago

0.0.2

4 years ago

0.0.7

4 years ago