Skip to content
This repository was archived by the owner on Mar 24, 2025. It is now read-only.

Commit d20c3f8

Browse files
committed
Better example
1 parent d42daaf commit d20c3f8

File tree

3 files changed

+509
-252
lines changed

3 files changed

+509
-252
lines changed

README.md

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,38 @@ VPAID ad class for extending purposes.
99
[![Greenkeeper badge](https://badges.greenkeeper.io/kahwee/vpaid-ad.svg)](https://greenkeeper.io/)
1010
[![codecov](https://codecov.io/gh/kahwee/vpaid-ad/branch/master/graph/badge.svg)](https://codecov.io/gh/kahwee/vpaid-ad)
1111

12-
This is a reference implementation of VPAID ad. Feel free to extend this to suit your needs.
12+
This is a reference implementation of VPAID ad. Feel free to extend this to suit your needs. It implements the most basic set of VPAID methods.
1313

14-
# Resources
14+
## Installing using npm
15+
16+
```sh
17+
npm i --save vpaid-ad
18+
```
19+
20+
## Usage
21+
22+
You can extend it using this way:
23+
24+
```js
25+
const Linear = require('vpaid-ad/src/linear')
26+
class VpaidAd extends Linear {
27+
initAd (width, height, viewMode, desiredBitrate, creativeData, environmentVars) {
28+
// Do something
29+
super.initAd(
30+
width,
31+
height,
32+
viewMode,
33+
desiredBitrate,
34+
creativeData,
35+
environmentVars
36+
)
37+
}
38+
}
39+
40+
window.getVPAIDAd = function () {
41+
return new VpaidAd()
42+
}
43+
```
44+
## Resources
1545

1646
* [MailOnline's VPAIDHTML5Client](https://github.com/MailOnline/VPAIDHTML5Client)

0 commit comments

Comments
 (0)