Skip to content

Instantly share code, notes, and snippets.

@ybootin
Created August 8, 2018 14:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ybootin/08fbc3314833c420e7d18d9f6238bfc0 to your computer and use it in GitHub Desktop.
Save ybootin/08fbc3314833c420e7d18d9f6238bfc0 to your computer and use it in GitHub Desktop.
<!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