Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(FEC-10015): support smart scrubber preview and timeline marker #359

Merged
merged 13 commits into from
Dec 10, 2020
67 changes: 60 additions & 7 deletions docs/advertisement-layout-management.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@ Ad break can be set as pre, mid and post rolls and each ad break can contain a s
- [Play Ads After Time](#play-ads-after-time)
- [Events](#events)
- [Play Ad Now](#play-ad-now)
- [Seekbar Cue Points](#seekbar-cue-points)

### Single Ad

Here's a simple scheme sample which contains 4 ad breaks: 1 pre-roll, 2 mid-rolls and 1 post-roll:

```ecmascript 6
```js
const config = {
...
plugins: {
Expand Down Expand Up @@ -65,7 +66,7 @@ An ad break may contain a list of ads, also referred to as ad pod.

Ad pod sample:

```ecmascript 6
```js
const config = {
...
plugins: {
Expand Down Expand Up @@ -108,7 +109,7 @@ An application may want to set a fallback vast url, so in case the primary ad re
This mechanism called _Waterfalling_, is configurable easily using the ad layout config.
Here's a sample of a mid-roll with waterfalling:

```ecmascript 6
```js
const config = {
...
plugins: {
Expand Down Expand Up @@ -158,7 +159,7 @@ Each ad in the `ads` list gets the following options:
All the options above work together, that means the application may use and mix them in the same `advertising` object.
Here's a sample:

```ecmascript 6
```js
const config = {
...
plugins: {
Expand Down Expand Up @@ -208,7 +209,7 @@ const kalturaPlayer = KalturaPlayer.setup(config);
An application may want to configure the player to play ads only from a specific time.
This can be achieved by `playAdsAfterTime` parameter. For example:

```ecmascript 6
```js
const config = {
...
plugins: {
Expand Down Expand Up @@ -241,7 +242,7 @@ In this sample, the player will skip the pre-roll, and will play the mid-roll on
This option can be used also when `playback.startTime` is set, which by default causes the player to skip the ads scheduled before the start time.
Although, An application may want to force the player to play these ads. This can be achieved also by `playAdsAfterTime` parameter. For example:

```ecmascript 6
```js
const config = {
...
playback: {
Expand Down Expand Up @@ -281,7 +282,7 @@ In addition to the current [ad events](./ads.md#ad-events) (`adbreakstart, adbre
All the above features are supported not only by `advertising` config, but also by `playAdNow` api which gets an ad pod as a parameter.
The app may call it whenever it wants to play an ad pod.

```ecmascript 6
```js
const config = {
...
plugins: {
Expand All @@ -300,3 +301,55 @@ kalturaPlayer.ads.playAdNow(
},
]);
```

### Seekbar Cue Points

To display cue points on the seekbar to indicates the ad break positions use `showAdBreakCuePoint` option, as following:
```js
const config = {
...
plugins: {
ima: {}
},
advertising: {
showAdBreakCuePoint: true,
adBreaks: [{
position: 60,
ads: [{
url: [MID_ROLL_VAST_URL]
}]
}
]
}
...
}
```

To customize the cue points style use `adBreakCuePointStyle` option. for example:
```js
const config = {
...
plugins: {
ima: {}
},
advertising: {
showAdBreakCuePoint: true,
adBreakCuePointStyle: {
marker: {
width: 10,
color: 'rgb(255, 0, 0)'
}
},
adBreaks: [{
position: 60,
ads: [{
url: [MID_ROLL_VAST_URL]
}]
}
]
}
...
}
```

All style options are listed [here](https://github.com/kaltura/playkit-js-timeline/blob/main/docs/types.md#cuepointoptionsobject).
Loading