我使用AVAudioPlayer为iPad创建了一个简单的音乐App。但问题是,当我按下主页按钮时,它只播放背景中的当前歌曲。应用程序无法在后台继续播放下一首歌曲。
答案 0 :(得分:0)
这对我有用
here musicPlayer is MPMusicPlayerController
[self setMusicPlayer: [MPMusicPlayerController applicationMusicPlayer]];
// By default, an application music player takes on the shuffle and repeat modes
// of the built-in iPod app. Here they are both turned off.
[musicPlayer setShuffleMode: MPMusicShuffleModeOff];
[musicPlayer setRepeatMode: MPMusicRepeatModeNone];