Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagexml
<script>
    var pbjs = pbjs || {};
    pbjs.que = pbjs.que || [];

    /* Prebid video ad unit */

    var videoAdUnit = {
        code: 'video1',
        mediaTypes: {
            video: {
                context: 'instream',
                useCacheKey: 1,
                playerSize: [320, 480],
                mimes: ['video/mp4'],
                protocols: [1, 2, 3, 4, 5, 6, 7, 8],
                playbackmethod: [2],
                skip: 1,
                renderer: {
                    render: function (bid) { 
                        invokeVideoPlayer(bid.vastUrl);
                   }
               }
            }
        },
        bids: [{
            bidder: 'eplanning',
            params: {
				ci: "'..."'
            }
        }]
    };

    pbjs.que.push(function() {
        pbjs.addAdUnits(videoAdUnit);

        pbjs.setConfig({
            debug: true,
            cache: {
                url: 'https://prebid.adnxs.com/pbc/v1/cache'
            }
        });

        pbjs.requestBids({
            bidsBackHandler: function(bids) {
                invokeVideoPlayer(bids.video1.bids[0].vastUrl);
            }
        });
    });

</script>

...