Custom Javascript (Youtube Player)
-
So I have this javascript code;
<script type="text/javascript">setTimeout("window.close();", 3000);</script>
that I am using to close a webpage after 3 seconds, I have tested it and it works as intended. However the functionality I’m really after is closing the page after a Youtube video ends – so I spent some time going through the Youtube Java API and found this;
player.getPlayerState():Number
Possible values are unstarted (-1), ended (0), playing (1), paused (2), buffering (3), video cued (5).
So I am trying to merge my initial script;
<script type="text/javascript">setTimeout("window.close();", 3000);</script>
with this;
player.getPlayerState():0
but I am relatively new to this area, please can someone explain how I can link these?
Thanks,
Best Regards,
AFX
- The topic ‘Custom Javascript (Youtube Player)’ is closed to new replies.