使用所提供的快速入门指南可以在IOS应用程序中播放SoundCloud音轨。在IOS应用程序中播放SoundCloud文件
提供给播放流的代码是在这里:
SCAccount *account = [SCSoundCloud account];
[SCRequest performMethod:SCRequestMethodGET
onResource:[NSURL URLWithString:audioFile]
usingParameters:nil
withAccount:account
sendingProgressHandler:nil
responseHandler:^(NSURLResponse *response, NSData *data, NSError *error) {
NSError *playerError;
audioPlayer = [[AVAudioPlayer alloc] initWithData:data error:&playerError];
audioPlayer.numberOfLoops = 0;
[audioPlayer prepareToPlay];
[audioPlayer play];
}];
问题:有没有发挥的SoundCloud文件,而无需先登录到您的SoundCloud帐户的方法?我们希望所有用户都考虑使用SoundCloud,但如果新用户以前可以听很多曲目,那么这对于可用性来说很有用。
你试过省略负责账户的初始化代码?你有特别的问题吗? – 2013-03-21 09:02:44
是的尝试设置帐户:无,没有工作,因此假设您需要登录到SoundCloud播放音频。 – Magnus 2013-03-21 15:00:31
马格努斯,我知道这是迟到,但我有同样的问题...你找到一个解决方法? – gg13 2013-04-04 02:50:03