Needed, Code for a Redirect once My Video completes!

2 replies
Hi all,

I am needing some help. I have posted this question before and still don't have an answer. I am wanting a way to play a video on my website and once this video finishes, I want it to redirect the viewer to an order page.

Does anyone know how to do this in Dreamweaver or do you have any Java Code or HTML code that will allow me to do this?

Thanks in advance for any information on this.

Mike
#code #completes #needed #redirect #video
  • Profile picture of the author Michael Mayo
    Hi Mike,

    You could try putting a couple of functions like this in the Head of your html page.

    Code:
     <script type="text/javascript">
    function playerReady(obj)
    {
    player = document.getElementsByName(obj.id)[0];
    player.addModelListener('STATE', 'stateMonitor');
    };
    
    function stateMonitor(obj)
    {
    if(obj.newstate == 'COMPLETED')
    {
    document.location.href = "newpage.html";
    }
    };
    </script>
    Hope that helps,
    Have a Great Day!
    Michael
    {{ DiscussionBoard.errors[907231].message }}
  • Profile picture of the author djtrillian
    The simple way to do it is by time. I have used a timeline in DW to show/hide layers and there is a simple script to redirect after a certain elapsed time. But the potential problem is that if the video caches ue to slow connection or if they can pause it etc. then the end of the video will not match up with the timing of the redirect script.

    If you use .wmv format you can embed a URL as a metacommand and that way it will always happen at the right time in the video.



    Originally Posted by MikeStronghill View Post

    Hi all,

    I am needing some help. I have posted this question before and still don't have an answer. I am wanting a way to play a video on my website and once this video finishes, I want it to redirect the viewer to an order page.

    Does anyone know how to do this in Dreamweaver or do you have any Java Code or HTML code that will allow me to do this?

    Thanks in advance for any information on this.

    Mike
    {{ DiscussionBoard.errors[907237].message }}

Trending Topics