Click here to Skip to main content
15,881,709 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I wanna play the video I tried the mediaplayer control but it not able to play the direct links(like youtube),It need to store the xxx.wmv extensions files in solution and just showing in browser,other than this wmv extension no other extensions like avi was not working.

And I also tried the media element, Im directly giving youtube link to source but its not displaying the video.



I'm working on silverlight application, I tried on silverlight no use, and I tried in web then I not able to upload the direct links. So my requirmnet is when user gives any link, any video with any extensions need to play with in that same page.





In XAML

private void StopMedia(object sender, RoutedEventArgs e)
{
MediaElement media = new MediaElement();
Uri address = new Uri("https://www.youtube.com/watch?v=3AYoipyqOkQ");
media.Source =address;
media.Play();



}


In aspx


XML
<form id="form1" runat="server">
        <asp:ScriptManager ID="jl" runat="server"></asp:ScriptManager>
   <div>
       <asp:MediaPlayer ID="MediaPlayer1" runat="server" Height="240px" Width="320px" MediaSkinSource="~/Simple.xaml" mediasource="~/NewFolder1/Butterfly.wmv"></asp:MediaPlayer>
   </div>
   </form>


In aspx.cs


C#
protected void Page_Load(object sender, EventArgs e)
   {

       MediaPlayer1.MediaSource = "~/NewFolder1/Butterfly.wmv"//working
 MediaPlayer1.MediaSource ="youtubelink";//not working
}
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900