MP4ERequest access
Runs in the backgroundBy MP4E Signed by mp4e

Linear ads

Plays your ad server's pre-, mid- and post-roll video ads, then returns viewers to where they were.

  • Sends 10 events
  • VAST 4 and VMAP from your own ad server
  • Pre-rolls, mid-rolls and post-rolls
  • Returns to the saved position after a break
  • A background service with no UI of its own
Version 1.2.0

It opens in the Studio, where you place it on your video.

Preview

This plugin has no picture of its own.

About

Linear ads plays video ads that take over the player for a moment: a preroll before the video, midrolls during it, a postroll at the end. The site that plays the video names its ad server; the plugin asks it for an ad when a break is due and hands the ad to the player as an interstitial break. When the break ends, the video resumes where it was.

  • What it does: at each break, one VAST 4 request to the host's tag; the ad's progressive MP4 closest to the target size plays as a break with the Ad controls template (time remaining, a skip button when the ad allows it, pause and mute, Learn more). Its Impression, quartile, skip, pause, resume, mute, unmute and click trackers fire as the break reports them; time the viewer keeps the ad paused does not count toward the break's time limit.
  • Preroll: by default it waits until the video plays (prerollStart onPlay), so a page that does not autoplay shows no ad until the viewer presses play; a viewer who starts past the first second gets no preroll. prerollStart onLoad requests it as soon as the plugin starts.
  • Breaks: breaks lists the offsets (start, end, HH:MM:SS or N%); without it, one preroll. With a VMAP URL, the VMAP's breaks are used instead, each with its own VAST tag. Each break plays at most once: one that is refused or fails is not asked for again, and a seek past several plays only the last. A plugin frame the player starts again mid-video (for example after a host overrides change) plays no preroll and skips every break already passed.
  • Shoppable ads: when the ad's VAST carries MP4E AdParameters naming the shoppable template, the break plays with the Ad offer card (Order, an email offer, Remind me) over the Ad controls, and holds on the ad's last frame until the viewer continues (holdSeconds, default 30). Install Ad offer in the video too. The ad's offer is data for Ad offer; an ad never brings code. Anything else in AdParameters plays the ad as an ordinary one.
  • Remind me: the first time a viewer asks, the same ad comes back once at the end of the video, opening on its card; no tracker fires for it again.
  • Attribution: the host's declared object (overrides defaultConfig.declared, e.g. { affiliate, campaign }) rides on every break with the break's adBreakId and adId, and comes back on every outcome the ad reports (Ad Outcome; the player's interstitial:outcome). An ad cannot change it.
  • The player decides: whether a break may run, when it starts and ends, and when it may be skipped are the player's; the ad's skip offset is a request, never a promise.
  • Privacy: no viewer id is read or sent. {viewerId} in the tag and [IFA] in trackers are always empty.
  • For hosts: set the ad server in overrides (plugins['mp4e:linear-ads'].defaultConfig.tagUrl or vmapUrl). A plugin may request a break only when the host lists it: config.interstitials.allowPlugins must include mp4e:linear-ads, otherwise every break is refused. The plugin names no network domains, so allow your ad server and its trackers in onNetworkGate. adControls { showPause, showMute } (both on by default) turns the template's pause and mute buttons off. Follow Ad Requested, Ad Started, Ad Progress, Ad Skipped, Ad Completed, Ad Ended (every end, with its reason and, when an ad card returned the viewer to the video, its label), Ad Refused and Ad Error. Shoppable ads also need mp4e:ad-offer installed; follow Ad Outcome and Ad Reminder too.

Settings

What a creator can set in the Studio, and what a host can set in its overrides.

Breaks

Breaks
SettingTypeDefaultWhat it does
BreaksbreaksList-When the ads play, with the VAST tag. Without a VMAP only.
Template plugintemplateTextmp4e:ad-controlsThe plugin that draws the break's controls; it gets clickThroughUrl, showPause and showMute in its config. A shoppable ad also stacks mp4e:ad-offer above it.
Ad controlsadControlsGroup of settings-Which of the template's controls the viewer gets. Passed to the template's config.
Hold (seconds)holdSecondsNumber, at least 130How long a shoppable ad holds on its last frame, with its card open, before the video resumes by itself. The host's maxHoldSeconds caps it.
Target widthtargetWidthNumber1280The MediaFile closest to this size plays (also the size of one that declares none).
Preroll startsprerollStartOne of
  • onPlay
  • onLoad
onPlayonPlay: the preroll waits until the video plays (none if the viewer starts past the first second). onLoad: requested as soon as the plugin starts.
Target heighttargetHeightNumber720See Target width.

Ad server

Ad server
SettingTypeDefaultWhat it does
VAST tagtagUrlText-Set by the host, through overrides. The ad server's VAST 4 tag; {cachebuster} is filled, {viewerId} is always empty. Empty (and no VMAP): no ads.
VMAP URLvmapUrlText-Set by the host, through overrides. A VMAP whose breaks, each with its own VAST tag, replace Breaks.
AttributiondeclaredGroup of settings-Set by the host, through overrides: its own attribution (e.g. { "affiliate": "…", "campaign": "…" }; string, number and boolean values) sent with every break and returned on every outcome.

Events and actions

Events you can react to

EventWhen it is sentData
Ad Endedplugin:mp4e:linear-ads:adEndedOne of this plugin's breaks ended, however it ended; the video resumes.
  • {{eventData.label}}Only for returned: the ad card's own reason for returning to the video, for example remindLater, orderPlaced or formSubmitted
  • {{eventData.reason}}How it ended, as the player reports it: completed, skipped, returned, maxSeconds, cancelled or error
  • {{eventData.breakId}}The break
Ad Errorplugin:mp4e:linear-ads:adErrorA break could not be played: no answer within 2 s, a network or HTTP error, an answer that is not VAST, no ad, only Wrapper ads, no playable MP4, or the ad failed while playing.
  • {{eventData.reason}}timeout, network, invalid, empty, wrapper, noMatch, request, playback or vmap
  • {{eventData.breakId}}The break (null when the VMAP could not be read)
Ad Outcomeplugin:mp4e:linear-ads:adOutcomeThe viewer answered one of this plugin's ads: orderPlaced, formSubmitted, remindLater, productSaved or clicked, with the player-checked fields (never personal data).
  • {{eventData.data}}orderPlaced: orderId, value, currency, productId, variant; formSubmitted: formId; productSaved: productId; otherwise empty
  • {{eventData.type}}orderPlaced, formSubmitted, remindLater, productSaved or clicked
  • {{eventData.breakId}}The break
Ad Refusedplugin:mp4e:linear-ads:adRefusedThe player refused the break (for example the host did not list this plugin in allowPlugins). It is not asked for again.
  • {{eventData.reason}}The player's reason: invalid, unsupported, busy, depth, disabled, initiator, source, placement, template, plugin, window, spacing or cap
  • {{eventData.breakId}}The break
Ad Skippedplugin:mp4e:linear-ads:adSkippedThe viewer skipped the ad; its skip trackers fired.
  • {{eventData.breakId}}The break
  • {{eventData.atSeconds}}Where in the ad it was skipped
Ad Startedplugin:mp4e:linear-ads:adStartedThe player started the break.
  • {{eventData.adId}}The ad's id in the ad server's answer
  • {{eventData.breakId}}The break
Ad Progressplugin:mp4e:linear-ads:adProgressThe ad reached a VAST progress point, or the viewer paused, resumed, muted or unmuted it; its trackers fired.
  • {{eventData.event}}start, firstQuartile, midpoint, thirdQuartile, complete, pause, resume, mute or unmute
  • {{eventData.breakId}}The break
Ad Reminderplugin:mp4e:linear-ads:adReminderThe reminder post-roll a viewer asked for (Remind me) started; breakId is the original break's id with _reminder.
  • {{eventData.breakId}}The reminder break (<original>_reminder)
Ad Completedplugin:mp4e:linear-ads:adCompletedThe break played to its end.
  • {{eventData.breakId}}The break
Ad Requestedplugin:mp4e:linear-ads:adRequestedA break is due: a request went to its VAST tag.
  • {{eventData.server}}The ad server's origin
  • {{eventData.breakId}}The break (its configured or VMAP id)

What it can reach

  • Contacts servers only when the host page allows the requestRequests the host's ad server (VAST/VMAP) and its tracking URLs; the host allows them in onNetworkGate.

Versions

  1. v1.2.0October 24, 2026Current
    What changed

    1.2.0: adEnded reports the player's new end reason returned (the ad's card sent the viewer back to the video after they engaged) with its label (remindLater, orderPlaced, formSubmitted); no skip tracker fires for it. 1.1.1: the default hold is 30 s (was 60). 1.1.0: shoppable ads: a VAST whose Linear carries MP4E AdParameters ({"mp4e":1,"template":"shoppable","offer":{…}}) plays with the Ad offer card over the Ad controls and holds on its last frame (holdSeconds, default 60); the host's declared attribution rides on every break; Remind me brings the same ad back once as a reminder post-roll opening on its card; new events Ad Outcome and Ad Reminder.

  2. v1.1.1October 23, 2026
    What changed

    1.1.1: the default hold is 30 s (was 60). 1.1.0: shoppable ads: a VAST whose Linear carries MP4E AdParameters ({"mp4e":1,"template":"shoppable","offer":{…}}) plays with the Ad offer card over the Ad controls and holds on its last frame (holdSeconds, default 60); the host's declared attribution rides on every break; Remind me brings the same ad back once as a reminder post-roll opening on its card; new events Ad Outcome and Ad Reminder.

  3. v1.1.0October 23, 2026
    What changed

    Shoppable ads: a VAST whose Linear carries MP4E AdParameters ({"mp4e":1,"template":"shoppable","offer":{…}}) plays with the Ad offer card over the Ad controls and holds on its last frame (holdSeconds, default 60); the host's declared attribution rides on every break; Remind me brings the same ad back once as a reminder post-roll opening on its card; new events Ad Outcome and Ad Reminder.

  4. v1.0.0October 22, 2026
    What changed

    First release: VAST 4 linear ads as engine interstitials — preroll, midrolls and postroll from configured offsets or a VMAP, one 2 s request per break, skip offset, click-through and the pause/mute switches passed to the Ad controls template, a preroll that waits for playback (prerollStart), Impression, quartile, skip, pause, resume, mute, unmute and click trackers, Ad Ended on every end, no preroll for a frame started mid-video, and no viewer id.

Works with

Linear ads · MP4E Marketplace