WIndows手机视频播放器

时间:2012-08-01 05:35:59

标签: windows video

我正在尝试在Windows Phone 7.1模拟器中播放视频。 任何人都可以建议在Windows手机中播放简单视频文件的链接或文章吗?

1 个答案:

答案 0 :(得分:1)

 <!xaml code in Main Page>
 <MediaElement Name="mediaElement" 
                      Source="xxxxxxxxxxxxxxxxxxxxxxx"
                      AutoPlay="False"
                      MediaOpened="OnMeenter code herediaElementMediaOpened"
                      MediaFailed="OnMediaElementMediaFailed"
                      CurrentStateChanged="OnMediaElementCurrentStateChanged"  />

  <!to play media by on click event>
  <shell:ApplicationBarIconButton
  IconUri="Images/appbar.transport.play.rest.png"
  Text="Play"
  Click="OnAppBarPlayClick" />


 <!this is based on click event>
 void OnAppbarPlayClick(object sender, EventArgs args)
 {
 mediaElement.Play();
 }


 //assign this code in main page

 public MainPage()
 {

 InitializeComponent();
 // Re-assign names already in the XAML file
 appbarPlayButton = this.ApplicationBar.Buttons[1] as ApplicationBarIconButton; 
 }
相关问题