我有一个问题:我添加MPMoviePlayerViewController
到了detailView
,但是当我点击按钮打开detailView
时,MPMoviePlayerViewController
会在全屏模式下自动播放。现在我想当点击按钮打开时DetailView
,MPMoviePlayerViewController
显示播放按钮而不是自动播放。然后用户点击播放按钮,MPMoviePlayerViewController 必须通过调用在 FULLScreen 中运行[self presentMoviePlayerViewControllerAnimated:moviePlayer];
。我怎样才能做到这一点?提前致谢。
movieURL = [NSURL URLWithString:previewString];
moviePlayer = [[MPMoviePlayerViewController alloc] initWithContentURL:movieURL];
moviePlayer.view.frame = CGRectMake(10,130, 275 , 150);
[moviePlayer.moviePlayer prepareToPlay] ;
moviePlayer.moviePlayer.shouldAutoplay = NO;
moviePlayer.wantsFullScreenLayout = NO;
moviePlayer.moviePlayer.controlStyle = MPMovieControlStyleEmbedded;
//[detailview addSubview:moviePlayer.view];
[self presentMoviePlayerViewControllerAnimated:moviePlayer];
如果尝试上述代码,moviePlayer 会自动以全屏模式运行。现在我想在开始时,moviePlayer 不会在全屏模式下自动运行,当用户单击播放按钮时,它将以全屏模式运行。