I started by trying to set the source from the page load event:
mediaPlay1.Source = "PathToMovie";
The player wouldn't load to the page because the media player tag was missing an element.
So I set it in a preInit method and got the page to display the media player but the movie wouldn't autoplay (wouldn't even load when I hit the play button).
That's when I made this post.
I looked up your suggestion on using an ASX file - too much work for this (i.e. - re-encoding from wmv to asf - just using the media player here as a side type thing on a personal web page that does something else. A hard coded array will work just fine :-)
Here's my function:
<
script type="text/javascript">function loadNewMovie(){ alert("entered loadNewMovie");
var sender = document.getElementById("MediaPlayer1");sender.MediaSource = "~/movies/Italiantime.wmv";
}
</script>
The alert works so I know I'm hitting it. But ... missing something. The next movie doesn't load. On hitting play I get the original movie that's set within the media player markup.
I did something similar to this with the ASP.NET AJAX Slidshow where I used a stand alone web service and server.mapPath and directory.getFiles to populate a string array of paths to pictures for the slideshow to display.