Sono andato a vedere un po di documentazione per l'oggetto asp:mediaplayer.
In effetti supporta il $find e non il $get.
Ho scaricato l'ultima versione della libreria System.web.SilverLight.dll ed ho fatto questo semplicissimo esempio funzionante:
Prova a scaricare anche tu:codice:<%@ Page Language="C#" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <script type="text/javascript"> function VediVideo() { //debugger; $get('mpContainer').style.display = 'block'; var video = $find('<%= MediaPlayer1.ClientID %>'); if (video != null) { video.set_mediaSource('IMG_0183.mov'); video.set_autoPlay('true'); //alert(video.get_mediaSource()); } } </script> </head> <body> <form id="form1" runat="server"> <div> <asp:ScriptManager ID="ScriptManager1" runat="server" /> <input id="Button1" type="button" value="button" onclick="VediVideo();" /> <div id="mpContainer" style="display: none;"> <asp:MediaPlayer ID="MediaPlayer1" runat="server" Width="640px" Height="480px" AutoPlay="false" /> </div> </div> </form> </body> </html>
http://archive.msdn.microsoft.com/aspnetprojects