Silverlight 4 MediaElement Source Problems with Uri

I'm having problems setting the Silverlight 4 MediaElement Source property in an ASP.NET MVC 2 application. I have a Windows 7 development machine and a Windows Server 2008 mid-tier server.

Locally, I used a MediaElement source, for example:

<MediaElement x:Name="VideoMediaElement" Source="Assets/126.mp4">
...
</MediaElement>

This source works on my development machine and my staging server, but I found that it only works on Google Chrome. After a lot of research and testing, I converted my application to establish the source:

<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 in Google Chrome. When I click this on my intermediate server, the path is calculated as:

<MediaElement x:Name="VideoMediaElement" Source="http://myDomain/MyVirtualDir/ClientBin/Assets/126.mp4">
...
</MediaElement>

, .

, , - . Uri, ?

Silverlight 4 MediaElement?

+3
2

: -

  • . IE, .
  • URL-. , XAP, - , , , .
  • , .
  • Fiddler2 , , , .

"/assets/126.mp4" "assets/126.mp4"?

404 URL-, , mime , .mp4?

.

+2

, HTTP-/? , ( ) , , , ... : http://www.fiddler2.com/fiddler2/

0

Source: https://habr.com/ru/post/1754471/


All Articles