我想在后台播放音频。
所以我在我的主要项目中做了这个
BackgroundAudioPlayer.Instance.Track = audioTrack;
BackgroundAudioPlayer.Instance.Play();
和内部音频后台代理:
protected override void OnUserAction(BackgroundAudioPlayer player, AudioTrack track, UserAction action, object param)
{
switch (action)
{
case UserAction.Play:
player.Play();
break;
case UserAction.Stop:
player.Stop();
break;
case UserAction.Pause:
player.Pause();
break;
case UserAction.FastForward:
player.FastForward();
break;
case UserAction.Rewind:
player.Rewind();
break;
default:
break;
}
NotifyComplete();
}
但是我收到了错误:
System.SystemException:HRESULT = 0xC00D001A
我还有另一个问题:关闭应用后,这会继续播放吗?