Using Silverlight MediaElement with Absolute URI
I am trying to create a small silverlight application. I have files that I host on my localhost. I want to be able to use a MediaElement to play them. However, I keep getting this annoying error message when I launch my silverlight app:
Error: Unhandled error in Silverlight 2 application SLControls.xap Code: 4001
Category: MediaError
Message: AG_E_NETWORK_ERROR
I am using the following line to initialize the MediaElement source:
Uri.TryCreate ( http: // localhost: /mywebsite/Data/Users/16/Channels/472.MP3 , UriKind.Absolute, out Channellocation);
Thanks in advance,
Vondiplo
Could there be a problem with the ":" after the localhost? Try this link: http: //localhost/mywebsite/Data/Users/16/Channels/472.MP3
You can debug network problems with Fiddler .
a source to share
Silverlight does not support cross-schema newtwork requests. If you are building an application from Blend 2 SP1 or don't want to create a test ASP.NET site, by default the IDE will automatically create a test page and run it using the file: // schema. Make sure you are not using the file: // scheme and make sure that if you pasted the url in your browser the file is successfully located.
a source to share