Reputation: 25969
I'm trying to play a WMV file in WP7 using a MediaElement control, but I always get an "ag_e_network_error" exception in the MediaFailed event of the MediaElement control. I found this solution, but it doesn't work for me because I don't have a phone connected at all. Any other solution you can think about?
Here's the xaml:
<MediaElement Grid.Row="0"
x:Name="mediaSample"
Source="/Media/Wildlife.wmv"
AutoPlay="True"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Height="200"
Width="200"
MediaOpened="MediaElement_MediaOpened"
MediaFailed="mediaSample_MediaFailed" />
The '/Media/Wildlife.wmv' 'Build Action' is set to 'Content' and 'Copy to Output Directory' is set to 'Copy Always'.
Thanks!
Upvotes: 0
Views: 2658
Reputation: 16826
It all depends on the codec the video is using.
Use this reference page for details.
Since you are trying to play a WMV video, you have specific restrictions (some codecs have specific resolution restrictions and one is not supported on the emulator at all):
The solution to this would be having a physical device. In fact, for any serious development for a mobile platform, you will need an actual phone, so I would recommend investing in one.
Upvotes: 2