如何使用c#为Windows手机应用程序播放在线播放的歌曲



我有流式URL(http://stereo.wavestreamer.com:8894)。如何在这个URL中播放在线播放的MediaElement中播放歌曲以及如何获得艺术家名称?

     I tried with the below code on button_click. Its not working.
    private void PlayBtn_Click(object sender, RoutedEventArgs e)
    {
        Player.Source = new Uri("http://stereo.wavestreamer.com:8894", UriKind.RelativeOrAbsolute);
        Player.Volume = 1.0;
        if (Player.CurrentState != MediaElementState.Playing)
        {
            Player.Play();
        } 
    }

你可以在这个链接上找到一个关于如何从你的应用程序流式传输音乐的例子。

你需要VS 2012和Windows Phone 8 SDK来打开它。

你应该可以这样做:

//You have to out your source link here to let the app work , enjoy :)  
Player.Source = new Uri("Your Link goes here", UriKind.RelativeOrAbsolute); 
if (Player.CurrentState != MediaElementState.Playing) 
{ 
    Player.Play(); 
} 

最新更新