Skip to content

Commit 22ad069

Browse files
committed
docs(Ads): Add new use case to Ads documentation (#7642)
1 parent 2cc7e1b commit 22ad069

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

docs/tutorials/ad_monetization.md

+35
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,41 @@ adManager.addCustomInterstitial({
113113
});
114114
```
115115

116+
You can also use this with SCTE-35:
117+
118+
```js
119+
const adManager = player.getAdManager();
120+
const video = document.getElementById('video');
121+
const ui = video['ui'];
122+
// If you're using a non-UI build, this is the div you'll need to create
123+
// for your layout. The ad manager will clear this div, when it unloads, so
124+
// don't pass in a div that contains non-ad elements.
125+
const container = video.ui.getControls().getClientSideAdContainer();
126+
adManager.initInterstitial(container, player, video);
127+
player.addEventListener('timelineregionadded', (e) => {
128+
const event = e.detail;
129+
if (event.schemeIdUri != 'urn:scte:scte35:2014:xml+bin') {
130+
return;
131+
}
132+
adManager.addCustomInterstitial({
133+
id: event.id,
134+
startTime: event.startTime,
135+
endTime: event.endTime,
136+
uri: 'YOUR_URL',
137+
isSkippable: false,
138+
skipOffset: null,
139+
skipFor: null,
140+
canJump: true,
141+
resumeOffset: player.isLive() ? null : 0,
142+
playoutLimit: null,
143+
once: false,
144+
pre: false,
145+
post: false,
146+
timelineRange: player.isLive(), // If true, the ad will appear as a range on the timeline.
147+
});
148+
});
149+
```
150+
116151

117152
##### VAST/VMAP (playback without tracking)
118153

0 commit comments

Comments
 (0)