我像这样嵌入了MPMoviePlayerController:
[_mediaPlayerView addSubview:moviePlayer.view];
[self addChildViewController:moviePlayer];
视频播放正常。当我点击全屏按钮播放器最大化,但我只看到控制按钮,屏幕是空白。装载指示器在旋转。当我取消最大化时,嵌入式视频控制器也是空白的。
答案 0 :(得分:0)
嵌入MPMoviePlayerController的正确方法:
self.mediaPlayer = [[MPMoviePlayerController alloc] initWithContentURL:url];
[self.mediaPlayer setMovieSourceType:MPMovieSourceTypeFile];
[self.mediaPlayer setControlStyle:MPMovieControlStyleEmbedded];
[self.mediaPlayer setShouldAutoplay:NO];
[self.mediaPlayer prepareToPlay];
[self.mediaPlayer.view setFrame:self.mediaPlayerView.bounds];
[self.mediaPlayerView addSubview:self.mediaPlayer.view];
self.mediaPlayerView.userInteractionEnabled = YES;