Preview
This plugin has no picture of its own.
About
Ad slots turns surfaces in the video — a billboard, a poster, a screen — into ad inventory that a host's ad server fills for each viewer. You declare the slots; the site that plays the video decides whether to sell them, by naming its VAST 4 ad server. Without one, every slot shows the house creative you chose, and the video plays as made.
- What it does: one VAST request fills every slot. The linear video ad goes to the video slot; each companion image goes to the image slot with the nearest shape, letterboxed when the shape differs, never stretched.
- Step 1: install Ad slots and list your slots (an id, image or video, the IAB size the surface matches, and its house creative).
- Step 2: make each slot a replacement zone whose source reads the plugin's creatives with the house creative as fallback, e.g. {{mp4e:ad-slots:creatives.billboard.src || 'media://house_billboard'}}.
- Step 3: on each slot's overlay, run Slot Visible on show (visible true) and on hide (visible false), so the plugin knows when the ad is on screen.
- Counting: an image counts after 1 s on screen, a video after 2 s of playing; then the ad's impression trackers fire, and for video its quartiles.
- Privacy: the viewer's country goes to the ad server; a viewer id only when the viewer has turned off both Do not track and Do not share identity.
- For hosts: set the ad server in overrides (plugins['mp4e:ad-slots'].defaultConfig.tagUrl) and follow Ad Requested, Ad Filled, Impression, Quartile, Ad Fallback, Ad Error and View Time.
Settings
What a creator can set in the Studio, and what a host can set in its overrides.
Slots
| Setting | Type | Default | What it does |
|---|---|---|---|
Ad slotsslots | List | - | The ad inventory in this video. Each slot is a replacement zone in the video; its id is what the zone's source and its Slot Visible actions name. |
Ad server
| Setting | Type | Default | What it does |
|---|---|---|---|
Ad server tagtagUrl | Text | - | Set by the host, through overrides, never in the file. The VAST tag URL, with macros {country}, {slots}, {cachebuster} and {viewerId}. Empty: no ad server, house creatives. |
Tag per slotslotTags | Group of settings | - | Set by the host. A tag URL for one slot ({ "screen": "https://…" }), used instead of the ad server tag for that slot. |
Country variablecountryVariable | Text | viewerCountry | The variable holding the viewer's country, sent as {country}. A change to it requests new ads. |
Viewer id variableviewerIdVariable | Text | - | Set by the host. The variable holding a viewer id, sent as {viewerId} only when the viewer has turned off Do not track and Do not share identity. Trackers' [IFA] macro carries it only when the request did: the tag must contain {viewerId}. Empty: never sent. |
Events and actions
Events you can react to
| Event | When it is sent | Data |
|---|---|---|
Ad Errorplugin:mp4e:ad-slots:adError | A request failed: no answer within 2 s, a network or HTTP error, an answer that is not VAST, or only Wrapper ads. |
|
Ad Filledplugin:mp4e:ad-slots:adFilled | A slot got a creative from the ad server. |
|
Quartileplugin:mp4e:ad-slots:quartile | The video slot's ad reached start, first quartile, midpoint, third quartile or complete on screen. |
|
View Timeplugin:mp4e:ad-slots:viewTime | A slot left the screen (or changed creative): how long it was shown. |
|
Ad Fallbackplugin:mp4e:ad-slots:adFallback | A slot keeps its house creative. |
|
Impressionplugin:mp4e:ad-slots:impression | A filled slot counted: on screen 1 s (image) or 2 s of playing (video). Its impression trackers fired. |
|
Ad Requestedplugin:mp4e:ad-slots:adRequested | A request went to the ad server (on load, and on every country change). |
|
Actions a rule or the host can call
| Action | What it does | Its settings |
|---|---|---|
Slot VisibleslotVisible | Tell Ad slots a slot's overlay was shown (visible true) or hidden (visible false). Run it from the slot overlay's On Show and On Hide. |
|
Variables it provides
| Variable | What it holds | Type and default |
|---|---|---|
Ad creatives{{mp4e:ad-slots:creatives}} | The filled slots: { slotId: { src, fit, kind, creativeId, durationSeconds? } }. A slot that is not filled is absent. Written by Ad slots only. | jsonRead only |
What it can reach
- Can contact: mp4e.com, api.mp4e.comAdwave, the demo ad server: its VAST answers (mp4e.com) and tracking pixels (api.mp4e.com). A host's own ad server goes through the host's network rules.
Versions
- v1.0.1November 28, 2026Current
What changed
1.0.1: variables say readOnly instead of the older editable flag. 1.0.0: First release: a VAST 4 client for in-video ad slots — one request per tag on load and on every country change, linear to the video slot and companions by nearest aspect ratio (contain when it differs), 2 s timeout to house creatives, viewability (image 1 s, video 2 s) with Impression, creativeView and quartile trackers, and a viewer id only with the viewer's consent.
- v1.0.0October 18, 2026
What changed
First release: a VAST 4 client for in-video ad slots — one request per tag on load and on every country change, linear to the video slot and companions by nearest aspect ratio (contain when it differs), 2 s timeout to house creatives, viewability (image 1 s, video 2 s) with Impression, creativeView and quartile trackers, and a viewer id only with the viewer's consent.