Order Now AdSolution Sign Up | Login » Bits on the Run Sign Up | Login »

Forums

/

Loading a Page After Video Done

8 replies [Last post]

Hi can someone help me figure out how to have the page redirect to a new page after a video is completed. I have the video loading in two different instances. One is right from the the index.html and another from a XML.

Thanks!

Unfortunelty Non of that work, I didnt know where to put the playerid and such. Very confused

 
Those links go to complete, working pages that you can simply copy & paste.

What more do you need?

I added that line of code but was a bit confused on where to put the playerid

It's not a line of code. It's the whole page.

Then you need to adjust all of your settings for your site and media files.

sorry for the misunderstand, when I mean the line of code I mean th enetire box of code that wa sposted. Where in it would replace it with my own player ID?

Is there any chance somone has a mirror or could someone post the whole code fot this page?
http://willswonders.myip.org:8074/Simple_OnCOMPLETED.html

Thanks

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

<html lang="en">

  <head>

    <title>Simple On COMPLETED - JWMP v4.6.x - swfobject v2.2</title>

    <script src="http://www.google.com/jsapi"></script>

    <script>
      google.load('swfobject', '2.2');
    </script>

    <script type="text/javascript">
      var flashvars =
      {
        'file':                                  '/video/ThingsFallApart.flv',
        'stretching':                            'uniform',
        'frontcolor':                            '86C29D',  // text & icons                  (green)
        'backcolor':                             '003367',  // playlist background           (blue)
        'lightcolor':                            'C286BA',  // selected text/track highlight (red)
        'screencolor':                           'FFFFFF',  // screen background             (black)
        'id':                                    'playerID',
        'autostart':                             'true'
      };

      var params =
      {
        'allowfullscreen':                       'true',
        'allowscriptaccess':                     'always',
        'bgcolor':                               '#FFFFFF'
      };

      var attributes =
      {
        'id':                                    'playerID',
        'name':                                  'playerID'
      };

      swfobject.embedSWF('player-4.6.397.swf', 'player', '500', '301', '9.0.124', false, flashvars, params, attributes);
    </script>

    <script type="text/javascript">
      var player    =  null;
      var playlist  =  null;

      function playerReady(obj)
      {
        player = gid(obj.id);
        addListeners();
      };

      function addListeners()
      {
        playlist = player.getPlaylist();

        if(playlist.length > 0)
        {
          player.addModelListener('STATE', 'stateMonitor');
          player.addModelListener('TIME',  'timeMonitor');
        }
        else
        {
          setTimeout("addListeners();", 100);
        }
      };

      function stateMonitor(obj)
      {
        if(obj.newstate == 'COMPLETED')
        {
          //...load a new page when the media file completes playing
          document.location = 'http://www.google.com';
        }
      };

      function timeMonitor(obj)
      {
        if(obj.position > 20.0)
        {
          //...load a new page when the media file plays to 20.0 seconds
          player.sendEvent('STOP');
          document.location = 'http://www.google.com';
        }
      };

      function gid(name)
      {
        return document.getElementById(name);
      };
    </script>

  </head>

  <body>

    <div id="playercontainer" class="playercontainer"><a id="player" class="player" href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash">Get the Flash Plugin to see this video.</a></div>

  </body>

</html>