ios - MPMusicPlayerController 直播

标签 ios iphone streaming mpmusicplayercontroller

我正在开发一个播放实时 HTTP 网络广播流(.pls、.mp3 ...)的应用程序。我可以使用 MPMusicPlayerController 来播放流吗?谢谢。

最佳答案

我认为您无法使用 MPMusicPlayerController 播放流音频。您应该查看 AVPlayer

NSURL *url = [NSURL URLWithString:url];    
AVURLAsset *asset = [AVURLAsset URLAssetWithURL:url options:nil];    
AVPlayerItem *playerItem = [AVPlayerItem playerItemWithAsset:asset];    
AVPlayer *audioPlayer = [AVPlayer playerWithPlayerItem:playerItem];    
[audioPlayer play];

关于ios - MPMusicPlayerController 直播,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20607433/

相关文章:

flash - 实时音频流替代方案 * 无 * Flash、Silverlight

ios - iOS 加速计游戏录制片段

ios - 使用 Sirikit xcode 8 的 RideBooking 概念

ios - swift 用户界面 : relationship between the sheet and list views

iphone - UILocalNotification 应用角标(Badge)编号重复

iphone - iPhone SDK:可以通过iPad设备访问Localhost吗? (调试时)

iphone - 评价我的应用程序的链接无法在 iPhone 上运行?

streaming - Kinesis 最新位置是如何记录的

ios - 从 CIRectangleFeature 坐标转换为 View 坐标

javascript - 使用nodejs以 block 的形式发送数据