I am having issues with setting the Silverlight 4 MediaElement Source property in my ASP.NET MVC 2 application. I have a Windows 7 development machine and a Windows Server 2008 staging server.
Locally I have been using a MediaElement source like:
<MediaElement x:Name="VideoMediaElement" Source="Assets/126.mp4">
...
</MediaElement>
This source works on my development machine and my staging server, but I found that this was only working in Google Chrome. After a great deal of research and testing I converted my app to set the source to be:
<MediaElement x:Name="VideoMediaElement" Source="http://localhost:40000/ClientBin/Assets/126.mp4">
...
</MediaElement>
Using this type of Uri allows my video to play on my local server in Internet Explorer as well as Google Chrome. When I push this up to my staging server the path is calculated to be:
<MediaElement x:Name="VideoMediaElement" Source="http://myDomain/MyVirtualDir/ClientBin/Assets/126.mp4">
...
</MediaElement>
This looks fine to me, but the video will not play in any browser on the staging server.
The differences I see between my development environment and the staging server is the virtual directory. Are there known problems or tricks when setting a full Uri that includes a virtual directory?
What is the preferred method for loading a video file from a file structure into a Silverlight 4 MediaElement?