--- title: "Ad integration" slug: "vpe-umd-ads" updated: 2026-09-17T09:22:36Z published: 2026-09-17T09:22:36Z canonical: "guide.ncloud-docs.com/vpe-umd-ads" stale: true --- > ## Documentation Index > Fetch the complete documentation index at: https://guide.ncloud-docs.com/llms.txt > Use this file to discover all available pages before exploring further. # Ad integration Available in Classic and VPC The SDK supports Google IMA SDK-based pre-roll ads. Pass a VAST or VMAP tag URL to `options.ads.tagUrl` to automatically play an ad before the content starts. **How it works** - The SDK automatically loads the Google IMA SDK externally. - During ad playback, the content pauses and the control bar hides. - The content automatically resumes after ad completion, skip, or error. **Limitations** - The skip button renders inside the IMA SDK iframe, preventing external styling. - Without ad options, the player operates identically to the existing playback flow. ## Basic usage The basic usage is as follows: ``` const player = new ncplayer("video", { playlist: [ { file: "https://CDN_DOMAIN/example.m3u8", }, ], autostart: true, muted: true, ads: { tagUrl: "https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/single_preroll_skippable&sz=640x480&ciu_szs=300x250%2C728x90&gdfp_req=1&output=vast&unviewed_position_start=1&env=vp&impl=s&correlator=", }, }); // Receiving ad events player.on("adStart", function(e) { console.log("Ad started"); }); player.on("adComplete", function(e) { console.log("Ad completed"); }); player.on("adSkip", function(e) { console.log("Ad skipped"); }); player.on("adError", function(e) { console.log("Ad error", e.data?.message); }); ``` ## Ad events | Event | Description | | --- | --- | | `adStart` | Ad playback started | | `adComplete` | Ad playback completed | | `adSkip` | User skipped the ad | | `adError` | Ad load/playback error | ## Disable ads Set `enabled` to `false` to disable ads. ``` ads: { tagUrl: "https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/single_preroll_skippable&sz=640x480&ciu_szs=300x250%2C728x90&gdfp_req=1&output=vast&unviewed_position_start=1&env=vp&impl=s&correlator=", enabled: false, } ``` ## Full HTML example ``` VPE Player - IMA ad
```