Skip to content

Commit 9985c38

Browse files
committed
Add ads support
1 parent e9ff332 commit 9985c38

File tree

5 files changed

+25
-12
lines changed

5 files changed

+25
-12
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Changelog
22
All changes to this project will be documented in this file.
33

4+
## [1.0.3] - 2023-06-12
5+
- Add ads support
6+
47
## [1.0.2] - 2023-02-15
58
- Add `privateSession` attribute
69

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
- [Settings](#settings)
2020
- [Controls](#controls)
2121
- [Player theme](#player-theme)
22+
- [Ads](#ads)
2223
- [Responsiveness](#responsiveness)
2324
- [Callbacks](#callbacks)
2425
- [Methods](#methods)
@@ -79,7 +80,7 @@ The following properties are used to configure the player. The value of each of
7980
| responsive | no | boolean | Weither if the player shoulb be responsive. See below [responsiveness](#responsiveness) | false |
8081
| videoStyleObjectFit | no | "contain" \| "cover" \| "fill" \| "none" \| "scale-down" | The `object-fit` CSS value of the video tag | undefined |
8182
| videoStyleTransform | no | string | The `transform` CSS value of the video tag (examples: "rotateY(180deg)") | undefined |
82-
83+
| ads | no | {adTagUrl: string} | see below [ads](#ads) |
8384
#### Controls
8485

8586
The `controls` property let you decide wich controls should be displayed on the player. Here is the list of all available controls: `play`, `seekBackward`, `seekForward`, `playbackRate`, `volume`, `fullscreen`, `subtitles`, `chapters`, `pictureInPicture`, `progressBar`, `chromecast`, `download`, `more`.
@@ -119,6 +120,12 @@ The `theme` property let you customize the color of some elements on the player.
119120
> }}/>
120121
> ```
121122
123+
124+
#### Ads
125+
Ads can be displayed in the player. To do so, you need to pass the `ads` option to the sdk constructor. In the `ads` object, pass the `adTagUrl` property with the url of the ad tag. The ad tag must be a VAST 2.0 or 3.0 url. For more information about VAST, check the [IAB documentation](https://www.iab.com/guidelines/vast/).
126+
127+
Note: ads are displayed using the [Google IMA SDK](https://developers.google.com/interactive-media-ads/docs/sdks/html5/quickstart).
128+
122129
#### Responsiveness
123130
124131
With `responsive={true}`, the player height will be automatically set to match the video with/height ratio, depending on the width of player.

package-lock.json

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@api.video/react-player",
3-
"version": "1.0.2",
3+
"version": "1.0.3",
44
"description": "api.video React player component",
55
"keywords": [
66
"player",
@@ -49,6 +49,6 @@
4949
"typescript": "^4.7.4"
5050
},
5151
"dependencies": {
52-
"@api.video/player-sdk": "^1.2.23"
52+
"@api.video/player-sdk": "^1.2.25"
5353
}
5454
}

src/index.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ export interface ApiVideoPlayerProps {
1818
metadata?: {
1919
[key: string]: string;
2020
};
21+
ads?: {
22+
adTagUrl: string;
23+
}
2124
hideControls?: boolean;
2225
hidePoster?: boolean;
2326
chromeless?: boolean;

0 commit comments

Comments
 (0)