【发布时间】:2016-03-04 13:16:35
【问题描述】:
我在 Windows Phone 8 中开发了一个应用程序。我有一个来自网络的 mp3 列表,但 mediaelement 无法播放它们。
这是我的代码
private void Button_Click_1(object sender, RoutedEventArgs e)
{
play.Source = new Uri("http://n1.xtek.gr/ime_ploigos/rest/narrations/gr/10.mp3",UriKind.RelativeOrAbsolute);
play.MediaOpened += new RoutedEventHandler(note1_MediaOpened);
}
void note1_MediaOpened(object sender, RoutedEventArgs e)
{
play.Play();
}
而 xaml 是:
<MediaElement HorizontalAlignment="Left" Height="100" Margin="167,538,0,0" VerticalAlignment="Top" Width="100" Name="play" AutoPlay="True"/>
我已经在 xaml 中尝试过它并播放它,但以编程方式没有。有人能帮我吗 ?
【问题讨论】:
标签: c# xaml windows-phone-8 windows-phone