You can probably use JavaScript or VBScipt to change the URL of a video in the embedded media player.
If you wanna do it on a server side, it really depends on a streaming server you use.
Examlple:
Microsoft: Windows Media Services: Server-side Playlist Ad Insertion