我的MPMoviePlayerController
iOS 应用程序中有一个流式传输来自 Amazon S3 的视频。视频播放正常,但似乎在设备上(我用 iOS 6 测试过,不确定其他设备),音频无法播放。音频在模拟器上工作正常,只是在设备上不行。
有人有什么想法吗?这是我的代码:
// Construct the video's URL
NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"http://s3.amazonaws.com/<mybucket>/%d.m4v",videoFileNumber]];
vidPlayer = [[MPMoviePlayerController alloc] initWithContentURL: url];
// Set up the video player
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(moviePlayBackDidFinish:)
name:MPMoviePlayerPlaybackDidFinishNotification
object:vidPlayer];
vidPlayer.scalingMode = MPMovieScalingModeAspectFill;
vidPlayer.controlStyle = MPMovieControlStyleDefault;
vidPlayer.shouldAutoplay = YES;
[self.view addSubview:vidPlayer.view];
[vidPlayer setFullscreen:YES animated:YES];
谢谢!