Make sure the ads module is activated when the SDK is loaded.

Display Ads

Configuration

Add the property ads.displayAds to the miniclipSDK initialization config.

<script>
MC.init({
            ads: {
                displayAds: {
                    "slot1": { "tag": "/6355419/Travel/Europe/France/Paris", "dimensions": [300, 250] },
                    "leaderboard1": { "tag": "/6355419/Travel/Europe/France/Paris", "dimensions": [728, 90] }
                }
            }
        }, 
        function(){
           MC.ads.updateSlot('slot1', { bottom: 10, align:"center"});
           MC.ads.showAd('slot1');
}); 
</script>

The above snippet initializes the SDK with a two display ads slots. When declared in the sdk initialization config, the slots will be created in the DOM.

Position Ads

By default they will be positioned in the top left corner.

Call MC.ads.updateSlot to set their position in the page.

Show Ads

Call MC.ads.showAd(<slot_id>) to show the ad slot.

Hide Ads

Call Mc.ads.hideAd(<slot_id>) to hide the slot.

Refresh Ads

Call Mc.ads.refreshSlot (<slot_id>) to refresh the ad in the slot.

Video Ads

Configuration

Add the property ads.videoAds to the miniclipSDK initialization config.

<script>
MC.init({
            ads: {
                videoAds: {
                    "preroll", { "tag": "<dfp_tag_here>" },
                    "midroll", { "tag": "<dfp_tag_here>" }
                }
            }
        }, 
        function(){}); 
</script>

By default, if available, a preroll will always be played.

Position Ads

The video ads will centered in the window above every other content.

Show Ads

Call ‘MC.ads.requestVideoAd( slotId )’ to show a new video ad.

The slot Id is one of the slots declared on the initialization config.