Web Monetization Video Ads
Web Monetization Video Ads is a utility
that allows developers
to do monetize videos
.
It uses web monetization when available and loads ads as fallback thorugh IMA SDK.
Prerequisites
Before you begin, ensure you have met the following requirements:
- You have installed the latest version of
<coding_language/dependency/requirement_1>
- You have a
<Windows/Linux/Mac>
machine. State which OS is supported/which is not. - You have read
<guide/link/documentation_related_to_project>
.
Installing
npmn install web-monetization-video-ads --save
Set Up
The package exposes 3 submodules:
-
initVideoMonetizer
start or stop web monetization whenever the video element play or pause. -
initVideoAdvertizer
a wrapper of IMA SDK used for advertize the video element -
initVideoAdsMonetizer
includes both of the submodules to provide web monetization and advertizing
Simple
The simple usage is by importing initVideoAdsMonetizer
and pass some configurations as follow:
import { initVideoAdsMonetizer } from "web-monetization-video-ads";
const paymentPointer = "$paymentpointer";
const tagUrl ="linkofthetag";
const videoElement = document.querySelector("#video-to-monetize");
initVideoAdsMonetizer({
videoElement,
monetizationConfig: {
paymentPointer,
},
adsConfig: {
tagUrl,
},
});
-
videoElement
start or stop web monetization whenever the video element play or pause. -
monetizationConfig
a wrapper of IMA SDK used for advertize the video element -
adsConfig
includes both of the submodules to provide web monetization and
Using
To use <project_name>, follow these steps:
<usage_example>
Add run commands and examples you think users will find useful. Provide an options reference for bonus points!
Contributing to <project_name>
To contribute to <project_name>, follow these steps:
- Fork this repository.
- Create a branch:
git checkout -b <branch_name>
. - Make your changes and commit them:
git commit -m '<commit_message>'
- Push to the original branch:
git push origin <project_name>/<location>
- Create the pull request.
Alternatively see the GitHub documentation on creating a pull request.
Contact
If you want to contact me you can reach me at your_email@address.com.
License
This project uses the following license: <license_name>.