Media Element source property in code behind
-
Hi, I am developing one application in that I have more than 5 media elements. I want to assign path to media element source from database.For that I have created one silverlight application and there is a ClientBin in silverlight website, I have saved my uploaded videos in clientbin and that path in database. But from code behind if i assign the path its not showing anything. my sample code is mplayer.Source = new System.Uri(@"D:\sample\sample.Web\ClientBin\Lake.wmv", UriKind.Absolute); Can you please tell me is there any other way to assign path to source property or what is the mistake I have done in that code. Thanks in Advance Pavani
-
Hi, I am developing one application in that I have more than 5 media elements. I want to assign path to media element source from database.For that I have created one silverlight application and there is a ClientBin in silverlight website, I have saved my uploaded videos in clientbin and that path in database. But from code behind if i assign the path its not showing anything. my sample code is mplayer.Source = new System.Uri(@"D:\sample\sample.Web\ClientBin\Lake.wmv", UriKind.Absolute); Can you please tell me is there any other way to assign path to source property or what is the mistake I have done in that code. Thanks in Advance Pavani
pavanip wrote:
mplayer.Source = new System.Uri(@"D:\sample\sample.Web\ClientBin\Lake.wmv", UriKind.Absolute);
You need to use URI strings that are appropriate for where the media actually is. You're showing an absolute URI for aaa place on a hardrive - the client knows nothing about a D drive, nor does it have access to its D drive. Besides, your media is on the server, not on the client. Here's a good article that should have what you need to know: Different ways for loading images and files in Silverlight 2 applications [^]
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
pavanip wrote:
mplayer.Source = new System.Uri(@"D:\sample\sample.Web\ClientBin\Lake.wmv", UriKind.Absolute);
You need to use URI strings that are appropriate for where the media actually is. You're showing an absolute URI for aaa place on a hardrive - the client knows nothing about a D drive, nor does it have access to its D drive. Besides, your media is on the server, not on the client. Here's a good article that should have what you need to know: Different ways for loading images and files in Silverlight 2 applications [^]
Mark Salsbery Microsoft MVP - Visual C++ :java: