私の iPhone アプリでは、小さなビューでビデオを再生したいと考えています。
ビデオの再生が自動的に開始され、再生の一時停止と全画面表示のボタンが非表示になります。
どうすればそれを達成できますか?
私の iPhone アプリでは、小さなビューでビデオを再生したいと考えています。
ビデオの再生が自動的に開始され、再生の一時停止と全画面表示のボタンが非表示になります。
どうすればそれを達成できますか?
MPMoviePlayerController *player = [[MPMoviePlayerController alloc] init];
[player prepareToPlay];
player.shouldAutoplay = NO;
player.allowsAirPlay = YES;
player.scalingMode = MPMovieScalingModeAspectFit;
[player.view setFrame:CGRectMake(0,0,300,320)];
[viewPlayer addSubview:player.view];
self.moviePlayer = player;//declare MPMoviePlayerController class object globaly for play and push the vedio if you want to add this functionality
願っています、これはあなたを助けます.... :)
のビューのフレームを手動で設定しMPMoviePlayerController
、コントロール スタイルを に設定しMPMovieControlStyleNone
ます。以下のように。
....
MPMoviePlayerController *player = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL fileURLWithPath:url]];
[player setControlStyle:MPMovieControlStyleNone];
//this is where you create your `embedded` view size
player.view.frame = CGRectMake(0, 0, 200, 300);
[self.view addSubview:player.view];
....