-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Video Outstream: prebid,js Error in Example #10944
Comments
patmmccann
changed the title
prebid,js Error in Example
Video Outstream: prebid,js Error in Example
Jan 16, 2024
I tried this already by obtaining a div apart from video1 and obtaining the video1 Id tag itself but it does not work with any div that is in the document either, <script> var pbjs = pbjs || {}; pbjs.que = pbjs.que || []; function callANRenderer(bid, ad) { const adResponse = { ad: { video: { content: ad, player_width: 640, player_height: 480, } } } bid.renderer.push(() => { window.ANOutstreamVideo.renderAd({ targetId: bid.adUnitCode, adResponse, }); }); } function render(bid) { let ad = bid.ad || bid.vastXml; if (ad) { callANRenderer(bid, ad) } else { if (bid.vastUrl) { (async() => { ad = await fetch(resp).then(resp => resp.text()); if (typeof ad === 'string') { callANRenderer(bid, ad); } else { console.log('Invalid VAST'); } })(); } else { console.log('Invalid ad'); } } } const adUnits = [{ code: 'video1', mediaTypes: { video: { context: 'outstream', playerSize: [ [640, 480] ], mimes: ['video/mp4'], protocols: [1, 2, 3, 4, 5, 6, 7, 8], api: [2], linearity: 1, playbackmethod: [2], skip: 1, renderer: { render, url: "https://acdn.adnxs.com/video/outstream/ANOutstreamVideo.js" }, maxduration: 30 } }, bids: [{ bidder: 'appnexus', params: { placementId: 31776638 } }] }]; pbjs.que.push(function() { pbjs.addAdUnits(adUnits); pbjs.setConfig({ debug: true, cache: { url: 'https://prebid.adnxs.com/pbc/v1/cache' } }); pbjs.requestBids({ timeout: 1000, bidsBackHandler: function(bids) { const highestCpmBids = pbjs.getHighestCpmBids('video1'); pbjs.renderAd(document.getElementById('myad'), highestCpmBids[0].adId); } }); }); </script>and this in the BODY
|
Related to prebid/prebid.github.io#5400 |
Also related: prebid/prebid.github.io#5248 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Error in Example outstream no server, https://docs.prebid.org/examples/video/outstream/pb-ve-outstream-no-server.html
We are working trying to separate this example but it has an error which happens to us in the same way in our demo.
ms: Error rendering ad (id: 31f3cda2d27635): renderAd was prevented from writing to the main document.
The text was updated successfully, but these errors were encountered: