0

私の iPhone アプリでは、小さなビューでビデオを再生したいと考えています。

ビデオの再生が自動的に開始され、再生の一時停止と全画面表示のボタンが非表示になります。

ここに画像の説明を入力

どうすればそれを達成できますか?

4

2 に答える 2

0
    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

願っています、これはあなたを助けます.... :)

于 2012-06-13T10:07:29.283 に答える
0

のビューのフレームを手動で設定し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];
....
于 2012-06-13T09:50:07.303 に答える