1

It's been a long time that I have been looking for a VPAID code example for a sample preroll ad but I can't find it.
Can anyone who knows one please help me? Thanks

P.S. I am using videojs

Soli
  • 842
  • 2
  • 11
  • 24

1 Answers1

1

Google have an example VPAID Preroll ad on their Github page, you can look at the javascript here: Javascript VPAID Preroll Creative

And this is the example tag to go with it: VPAID Preroll VAST Tag

...Which you can test on their test page here: Google IMA Test Player

That should be everything you need! :)

Oli C
  • 1,120
  • 13
  • 36
  • Thanks but I need a complete package. Where does it parse vast? How to ad it to HTML, etc... – Soli Nov 13 '17 at 17:04
  • Oh, well it might be quite hard to actually find a full functional product, as most ad companies probably aren't willing to open-source their code. The only other creative I could find is this one: http://ryanthompson591.github.io/vpaidExamples/examples/VpaidVideoAd.js You don't need to add it to HTML- It looks like you just need to request the VAST, then parse that to get the video (I think this should be quite simple using an XML parsing library. Then you can play the video by calling the function on the videoSlot which is passed in to the creative at runtime. Hope that helps. – Oli C Nov 13 '17 at 17:27
  • Thank you Oli. I will try it. – Soli Nov 14 '17 at 11:33