Skip to content
WJunction - Webmaster Forum

Help with Javascript code

Status
Not open for further replies.

bxflow

Distinguished Member
4,686
2010
621
Code:
<div id="sbplayer"> 
           
       <script language="javascript" type="text/javascript" src="http://www.springboardplatform.com/jsapi/embed"></script>
 
       <div id='myvideo'>
              <div class="videoPlayer" id="ilac001_c93e12a9b67694946483ec5a974b0414"></div>
       </div>
 
       <script language="JavaScript" type="text/javascript"> 
        
        //writeVideo function which renders the player using the JS API
       function writeVideo()
       {
              $sb("ilac001_c93e12a9b67694946483ec5a974b0414",{"sbFeed":{"partnerId":1701,"type":"channel","contentId":641905,"items":1,"cname":"ilovearcade"},"style":{"width":325,"height":280}});
       }
 
       </script>                                
</div>
 
<script language="JavaScript" type="text/javascript">               
writeVideo();
$sb("ilac001_c93e12a9b67694946483ec5a974b0414_api").onBeforeBegin(function()
    {
       [B][COLOR="Red"] // call function once pre roll finishes[/COLOR][/B]
    });
</script>

"The code above will dynamically write the player embed code using our JS API to the myvideo div HTML object with the writeVideo() function.
Once the player initializes, we listen to the onBeforeBegin event to be fired from the player (it fires after a successful pre roll) and then in it you call whatever function you need (e.g. remove/hide the player from your site or similar)."

What I am trying to do with this code is to show a custom alternative once this pre-roll ads finishes. How would I edit this code or add a call function which will show a file after the pre-roll is finished. for example a .SWF file.
 

1 comment

Status
Not open for further replies.

About the author

B
Distinguished Member · Joined
Looking out my skyscraper window
4,686
Messages
621
Reactions
113
Points
Grow your business

Advertise on WJunction

Connect with an established international community of webmasters, hosting providers, developers and online entrepreneurs.

  • Premium & Premium+ Sticky
  • Dedicated section banners
  • Site-wide banner advertising
Explore advertising options
Back
Top Bottom