是的,我研究了发生了什么,但就我而言,我确信音频的格式是有效的,因为它是来自 iTunes 商店预览的 m4a 文件,我的 4s 设备可以毫无问题地播放。
任何提示表示赞赏
-(IBAction)StartMusic
{
NSLog(@"start");
NSURL *songUrl = [NSURL URLWithString:@"http://a1804.phobos.apple.com/us/r1000/064/Music/v4/9b/b3/c7/9bb3c7dc-a06f-f18c-3e41-2ce1e36f73b4/mzaf_7432104896053262141.aac.m4a"];
MPMoviePlayerController *mp = [[MPMoviePlayerController alloc] initWithContentURL:songUrl];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(moviePlayBackDidFinish:)
name:MPMoviePlayerPlaybackDidFinishNotification
object:nil];
[mp setControlStyle:MPMovieControlStyleFullscreen];
[mp setMovieSourceType:MPMovieSourceTypeStreaming];
[mp setFullscreen:YES];
[mp.view setFrame: self.view.bounds];
[self.view addSubview:[mp view]];
[mp prepareToPlay];
[mp play];
NSLog(@"start 2");
}