Theres a live example available on my website that changes the source of a music file for the player. The source code may be complicated to look at but in essence heres what you would do...
You need the link for the new videos, and a div around the actual player
1: Add an "onclick" event to your link (that does not have an href, or use span etc...). Make up your function name and use the first parameters as the new location of the target video.
2: Make the function in javascript rewrite the entire embed code
3: Use the document.innerhtml method to rewrite the div that containts the flash.
HTML Code:
<head>
<script type="text/javascript">
function changeVideo(target)
{
src = "<embed src='myplayer.swf?url=" + target + "' width='500' height='400'>";
document.getElementById('VideoDiv').innerHTML=src;
}
</script>
</head>
<body>
<div id="VideoDiv"><embed>...</embed></div>
...
<a onclick="changeVideo('/videos/mymovie.flv')"><img ...></a>
</body>
|