How to detect when a youtube video finishes playing?

This can be done through the youtube player API: http://jsfiddle.net/7Gznb/ Working example: <div id=”player”></div> <script src=”http://www.youtube.com/player_api”></script> <script> // create youtube player var player; function onYouTubePlayerAPIReady() { player = new YT.Player(‘player’, { width: ‘640’, height: ‘390’, videoId: ‘0Bmhjf0rKe8’, events: { onReady: onPlayerReady, onStateChange: onPlayerStateChange } }); } // autoplay video function onPlayerReady(event) { event.target.playVideo(); } // … Read more

What is the best way to stop people hacking the PHP-based highscore table of a Flash game

This is a classic problem with Internet games and contests. Your Flash code works with users to decide a score for a game. But users aren’t trusted, and the Flash code runs on the user’s computer. You’re SOL. There is nothing you can do to prevent an attacker from forging high scores: Flash is even … Read more