Skip to main content
Version: v1.0.0

Video

Video demand comes in three shapes:

  • Outstream in a banner slot: PrebidBannerAd with adFormats: {PrebidAdFormat.video}.
  • Fullscreen video: PrebidInterstitialAd with adFormats: {PrebidAdFormat.video}, or PrebidRewardedAd.
  • In-stream, played by your own video player or IMA: PrebidInstreamVideoAd, below.

In-stream video​

PrebidInstreamVideoAd runs the auction and returns targeting keywords; your ad server (for example Google Ad Manager through the IMA SDK) returns the winning VAST.

final video = PrebidInstreamVideoAd(
configId: 'prebid-demo-video-interstitial-320-480-original-api',
size: const Size(640, 480),
videoParameters: const VideoParameters(
mimes: ['video/mp4'],
protocols: [VideoProtocol.vast2_0, VideoProtocol.vast3_0, VideoProtocol.vast4_0],
playbackMethods: [VideoPlaybackMethod.autoPlaySoundOff],
plcmt: VideoPlcmt.instream,
startDelay: VideoStartDelay.preRoll,
maxDuration: 30,
),
);

final bid = await video.fetchDemand();
if (bid.isSuccess) {
// Append bid.targetingKeywords to your ad tag's cust_params.
}
await video.destroy();

PrebidVideoAdBidResponse has the resultCode, targetingKeywords, isSuccess and the bid's exp (seconds before it expires).

PrebidInstreamVideoAd also takes gpid, pbAdSlot, impOrtbConfig and globalOrtbConfig.

For the IMA SDK, Prebid builds the Google Ad Manager VAST tag URL from the keywords:

final adTagUrl = await PrebidInstreamVideoAd.generateInstreamUriForGam(
gamAdUnitId: '/1234567/your-video',
sizes: const [Size(640, 480)],
targetingKeywords: bid.targetingKeywords ?? const {},
);

iOS only Prebid iOS only accepts 400x300, 640x480 and 320x480 there; other sizes throw a PlatformException.

Video parameters​

VideoParameters describes what your player supports. The same class configures interstitial, rewarded, outstream, multiformat, Original API and in-stream requests.

const params = VideoParameters(
mimes: ['video/mp4', 'video/webm'],
protocols: [VideoProtocol.vast3_0, VideoProtocol.vast4_0],
playbackMethods: [VideoPlaybackMethod.autoPlaySoundOff],
api: [VideoApi.omid1],
plcmt: VideoPlcmt.accompanyingContent,
startDelay: VideoStartDelay.genericMidRoll,
linearity: VideoLinearity.linear,
skippable: true,
battr: [VideoCreativeAttribute.annoying, VideoCreativeAttribute.surveys],
minDuration: 5,
maxDuration: 30,
minBitrate: 300,
maxBitrate: 1500,
);
FieldOpenRTBValues
mimesmimesRequired. MIME types, e.g. video/mp4.
protocolsprotocolsvast1_0 … vast4_0 and their …Wrapper variants.
playbackMethodsplaybackmethodautoPlaySoundOn, autoPlaySoundOff, clickToPlay, mouseOver, enterSoundOn, enterSoundOff.
apiapivpaid1_0, vpaid2_0, mraid1, ormma, mraid2, mraid3, omid1.
plcmtplcmt (2.6)instream, accompanyingContent, interstitial, noContent.
placementplacement (deprecated)inStream, inBanner, inArticle, inFeed, interstitial. Prefer plcmt.
startDelaystartdelaySeconds, or VideoStartDelay.preRoll (0), genericMidRoll (-1), genericPostRoll (-2).
linearitylinearitylinear (in-stream) or nonLinear (overlay).
skippableskipWhether the player lets the user skip.
battrbattrBlocked creative attributes, e.g. annoying, surveys, pop.
minDuration, maxDurationminduration, maxdurationSeconds.
minBitrate, maxBitrateminbitrate, maxbitrateKbps.
sizew, hPlayer size. Set it for Original API video (multiformat); in-stream video takes its own size.

Every field except mimes is optional; unset fields are left out of the request.

Where each field is sent​

RequestAndroidiOS
In-stream, multiformat, Original APIEvery fieldEvery field
Prebid-rendered interstitial / rewardedSDK defaults; maxDuration caps the rendered videoEvery field
AdMob / MAX interstitial / rewardedSDK defaults; maxDuration caps the rendered videoEvery field
GAM interstitial / rewardedSDK defaults; maxDuration caps the rendered videoEvery field
Banner (outstream)SDK defaults plus the placementEvery field

Prebid Android exposes no video-parameters setter on its rendering and mediation units, which is why those rows send the SDK's defaults.