我正在尝试在 windows phone 7.1 模拟器中播放视频。任何人都可以建议在 windows phone 中播放简单视频文件的链接或文章吗?
问问题
101 次
1 回答
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;
}
于 2012-10-26T09:46:13.953 回答