Cannot play local WMV in silverlight MediaElement
I am trying to play a video in WMV format in a silverlight MediaElement.
<StackPanel>
<Grid x:Name="LayoutRoot">
<MediaElement x:Name="media" Source="Bounce.wmv"
Width="300" Height="300" AutoPlay="True" />
</Grid>
</StackPanel>
This does nothing.. but if I change the source attribute to point to some WMV out on the web it works.
What am I doing wrong? I have the th开发者_StackOverflow社区e movie in the same directory as the MainPage.xaml
Well, it would depend on what page you are calling it from. If you are calling from a different XAML page that is in a sub-directory, like Views, you'll need to change the Source
to a relative path. Give Source="\Bounce.wmv"
and Source="..\Bounce.wmv"
a try, depending on the folder structure you are in when calling it.
精彩评论