|
Turn on suggestions
![]() Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type. | |
If you don't find an answer, please click here to post your question.
|
09-17-2013 03:17 PM - edited 09-18-2013 07:22 AM
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html lang="en"> <head> <title>VAST Flash Demo</title> <script src='http://player.ooyala.com/v3/cc941e80e21e4d2587c9bb4678a4597d'></script> <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script> <script src="http://underscorejs.org/underscore.js"></script> </head> <body> <div id='player_container' style='display:inline-block;width:640px;height:480px'></div> <div id='cad' style='width:300px;height:250px;border:1px solid black; background-image:url("img/300x250companion.png")'></div></br> <script> var player = OO.Player.create('player_container', 'F4cHVqZDrC6HRLOgEPBU56S4SvDpgAFu',{ onCreate: function(player){ mesb=player.mb; // Listen to WILL_SHOW_COMPANION_ADS event mesb.subscribe(OO.EVENTS.WILL_SHOW_COMPANION_ADS, 'ads', OO._.bind(showCompanionAds,this)); mesb.subscribe(OO.EVENTS.ADS_PLAYED, 'adDemo' ,_.bind(adsPlayed,this)); player.mb.subscribe('*', 'test', function(event) { if (!event.match(/playheadTimeChanged/)) { console.log(event + JSON.stringify(arguments)); } if (event.match(/playing/)) { player.setVolume(0); } }); } }); function showCompanionAds(eventName,companionAds){ // Modify 'cad' div var img = OO.$("<img>"); img.attr("src",companionAds.ads[0].url); $('#cad').append(img); // Ping tracking URLs for (var index = 0; index < companionAds.ads[0].creativeViewUrl.length; index += 1) $.ajax( {url: companionAds.ads[0].creativeViewUrl[index], dataType: 'jsonp',} ); } function adsPlayed(){ $('#cad img').hide(); } </script> </body>
</html>
09-24-2013 04:52 AM
09-24-2013 04:54 AM