Skip to content

Instantly share code, notes, and snippets.

@ybootin ybootin/vpaid.html
Created Aug 8, 2018

Embed
What would you like to do?
<!doctype html>
<html>
<body>
<div id="vpaid-container">
<div id="video-container"></div>
<div id="ad-container" style="width:400px;height: 300px"></div>
</div>
<script>
var vpaidAd
var script = document.createElement('script')
var video = document.createElement('video')
video.setAttribute('muted', 'true')
document.getElementById('video-container').appendChild(video)
script.onload = function() {
vpaidAd = window.getVPAIDAd()
vpaidAd.subscribe(function() {
vpaidAd.startAd()
}, 'AdLoaded')
vpaidAd.initAd(400, 300, 'normal', 512, {AdParameters:'{"creativeId":"17ca4647-eabd-8885"}'}, {
slot: document.getElementById('ad-container'),
videoSlot: video,
videoSlotCanAutoplay: true,
})
}
script.src = 'https://loader.seedtag.com/vpaid.js'
document.body.appendChild(script)
setTimeout(function() {
vpaidAd.resizeAd(300, 200, 'normal')
}, 3000)
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.