GPlayer demo

This page is on http://. The IMA SDK will refuse every ad request here (error 1005), so the outstream placement collapses and the instream one plays content without an ad. Run DEV_HTTPS=1 pnpm demo and open the https:// URL.

Both players below are created from markup alone: the loader tag at the bottom of this page is the only script. Ads come from Google's public sample tags, so this needs the network and HTTPS (DEV_HTTPS=1 pnpm demo): the IMA SDK refuses to request ads from an http:// page, localhost included.

Instream: pre-roll, content, mid-roll, post-roll

Starts muted as soon as the pre-roll is ready. The content follows; a mid-roll interrupts it at 15 seconds (data-midrolls="15") and a post-roll plays when it ends (data-postroll), both requested from the same tag. If any break fails, the content simply plays on. Replay starts over from the pre-roll. With a VMAP tag (ad_rule=1) leave both attributes out: the tag carries its own schedule.

waiting for the core…

(scroll — the outstream placement below is not fetched or started until you get there)

Outstream: in-article

The placement below has no height of its own. Once an ad is ready and you scroll to it, it opens, pushing this text apart, and the ad starts. Scroll past it and the player docks to the bottom-right corner and keeps playing; scroll back and it returns here. When the ad has played, or when you close it, the placement closes again and the text moves back up. Add data-float="false" to pause in place instead of docking.

waiting for the core…

Article copy continues after the placement, and moves up once it collapses.