【发布时间】:2014-06-16 20:36:11
【问题描述】:
谁能帮我在windows phone上播放视频。
我已经在列表框中显示了我的所有视频。当我立即单击特定视频时,它应该导航到其他页面并播放。当我单击特定视频时,它正在导航到其他页面但不播放。我没有收到任何错误甚至警告。
导航页面中的 Xaml 代码:
<MediaElement x:Name="player" AutoPlay="True"/>
导航页面中的 Xaml.cs 代码:
protected async override void OnNavigatedTo(NavigationEventArgs e)
{
if (!NetworkInterface.GetIsNetworkAvailable())
{
MessageBox.Show("An error has occurred! Please verify your internet connection.");
NavigationService.GoBack();
}
else
{
string songcode = "";
if (NavigationContext.QueryString.TryGetValue("songcode", out songcode))
{
var url = await YouTube.GetVideoUriAsync(songcode, YouTubeQuality.Quality480P);
player.Source = url.Uri;
}
我是 Windows Phone 应用程序的初学者。
请任何人帮助我。
非常感谢。
【问题讨论】:
标签: c# windows-phone-8