• Resolved Lo?c Levêque

    (@luisobispo)


    Hello,

    I would like to know if there is any possibility to redirect automatically the viewers from an index html to the home page after few seconds, and, if yes, is it possible to decide how many seconds.

    Thanks.

Viewing 1 replies (of 1 total)
  • Thread Starter Lo?c Levêque

    (@luisobispo)

    Hi everyone,

    I just wanted a redirection after a flash video end.

    I just found a solution in Yahoo:

    <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’);
    }
    else
    {
    setTimeout(“addListeners();”, 100);
    }
    };

    function stateMonitor(obj)
    {
    if(obj.newstate == ‘COMPLETED’)
    {
    //…load a new page when the media file completes playing
    document.location = ‘https://www.yourpage.com&#8217;;
    }
    };

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

    I just copied that in my header and it works.

    I hope it can help someone else.

    Have a nice day.

Viewing 1 replies (of 1 total)
  • The topic ‘redirecting automatically after few second?’ is closed to new replies.