我正在为Windows Phone 8开发一个互联网广播应用程序。 我一直在添加" Stream.mp3"到我的shoutcast网址,以获取流文件作为MP3文件,例如。 " http://xx.xxx.xxx.xxx:0000/; file.mp3&#34 ;.
我的样本流是 1)radyo.ersu.net:3400/;stream.mp3 2)5.172.194.10:9996/;file.mp3
这在我的Windows Phone 7.x设备上运行正常。
但是,我尝试在Windows Phone 8手机上测试它并且它无法正常工作。
知道发生了什么事吗?
谢谢!
protected override void OnUserAction(BackgroundAudioPlayer player, AudioTrack track, UserAction action, object param)
{
player = BackgroundAudioPlayer.Instance;
try
{
switch (action)
{
case UserAction.Play:
if (player.PlayerState != PlayState.Playing)
{
player.Track = new AudioTrack(new Uri("http://5.172.194.10:9996/; file.mp3", UriKind.Absolute), "Radio name", null, null, null);
player.Volume = 1;
player.Play();
}
break;
case UserAction.Stop:
player.Stop();
break;
case UserAction.Pause:
player.Pause();
break;
}
}
catch (SystemException)
{ }
NotifyComplete();
}