我刚刚遇到了一个看似很小的问题。我正在使用 MPMovieViewController 循环一个小的非音频视频文件。当我进入包含它的 ViewController 时,它会禁用任何背景音乐,这是完全没有必要的。我尝试过 AVPlayer,但它的效果相同,而且循环似乎特别困难。
MPMovieController 的代码没有什么特别之处:
NSString *moviePath = [[NSBundle mainBundle] pathForResource:videoFile ofType:@"m4v"];
NSURL *movieURL = [NSURL fileURLWithPath:moviePath];
player = [[MPMoviePlayerController alloc] initWithContentURL:movieURL];
player.view.frame = CGRectMake(0, 0, 128, 128);
[self.movieView addSubview:player.view];
player.repeatMode = MPMovieRepeatModeOne;
player.controlStyle = MPMovieControlStyleNone;
[player prepareToPlay];
禁用视频播放或整个应用程序的音乐中断都可以,我不使用任何音频。
多谢你们!