DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Load A Page After Video Finishes Playing

09.25.2006
| 5482 views |
  • submit to reddit
        You can do this using Windows Media Player, adding javascript to the page to handle the playStateChange event to detect when the video finishes playing. (Should work with any video type that Windows Media Player supports.)

http://www.mioplanet.com/rsc/embed_mediaplayer.htm
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmplay10/mmp_sdk/playerplaystatechange.asp

<SCRIPT LANGUAGE="JScript"  FOR="Player" EVENT="playStateChange(NewState)">

// Test for the player current state, display a message for each.
switch (NewState){
    case 1:
        window.href="xxx.htm";
        break;
}
</SCRIPT>