1

ビデオの再生を開始するとすぐに MPMoviePlayerViewController を強制的にフルスクリーンで再生する方法を教えてください。setFullScreen:animated: 関数を試しましたが、機能しません。それで、誰かがこれから私を助けることができますか?前もって感謝します。

また、アプリケーション バンドルのビデオ ファイルのみを使用しています。

4

2 に答える 2

5

これで私の問題は解決しました。

NSURL *movieUrl = [NSURL fileURLWithPath: [[NSBundle mainBundle] pathForResource:@"appVid"
                                                                          ofType:@"mp4"]];
moviePlayer = [[MPMoviePlayerController alloc]initWithContentURL:movieUrl];
moviePlayer.controlStyle = MPMovieControlStyleFullscreen;
moviePlayer.scalingMode = MPMovieScalingModeAspectFill;
moviePlayer.shouldAutoplay = YES;
moviePlayer.view.frame = [[UIApplication sharedApplication]keyWindow].bounds;
[[[UIApplication sharedApplication]keyWindow] addSubview:moviePlayer.view];

[moviePlayer setFullscreen:YES animated:YES];

[moviePlayer play];
于 2013-10-18T08:53:24.090 に答える