【发布时间】:2015-12-04 20:52:29
【问题描述】:
我正在使用 AVPlayer 在我的应用程序中流式传输 SoundCloud 歌曲,但其中一些不起作用,尽管流式传输标志为真。 Kendrick Lamar 的“Black Friday”是一首无效歌曲的例子,带有流媒体 URL
https://api.soundcloud.com/tracks/234989572/stream?client_id={MY_CLIENT_ID}
(当然,{MY_CLIENT_ID} 是实际 ID)
这是 AVPlayerItem 返回的错误(同样隐藏了真实的客户端 ID):
Error Domain=NSURLErrorDomain Code=-1100 "The requested URL was not found on this server."
UserInfo=0x7fe735752340 {NSUnderlyingError=0x7fe735751e30 "The operation couldn’t be completed. (OSStatus error -12938.)",
NSErrorFailingURLStringKey=https://api.soundcloud.com/tracks/234989572/stream?client_id={MY_CLIENT_ID},
NSErrorFailingURLKey=https://api.soundcloud.com/tracks/234989572/stream?client_id={MY_CLIENT_ID},
NSURL=https://api.soundcloud.com/tracks/234989572/stream?client_id={MY_CLIENT_ID},
NSLocalizedDescription=The requested URL was not found on this server.}
大多数歌曲都可以正常播放,例如 G-Eazy 的“Everything Will Be OK”。网址:
https://api.soundcloud.com/tracks/236005149/stream?client_id={MY_CLIENT_ID}
为什么有些歌曲,比如黑色星期五,失败了?
【问题讨论】:
标签: ios soundcloud avplayer