インストール済みXcode 4.5、MpMoviePlayerControllerはもう機能しません

StackOverflow https://stackoverflow.com//questions/12667406

  •  11-12-2019
  •  | 
  •  

質問

Xcode 4.5に「アップグレードする」とき、私のアプリの中のビデオはすべてまったく遊んでいない場合は非常に嬉しかったです。

一般的に私はこのようなことをします:

self.moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:[self getBundleClip:@"theVideo"]];
self.moviePlayer.controlStyle = MPMovieControlStyleNone;
self.moviePlayer.shouldAutoplay = YES;
self.moviePlayer.repeatMode = MPMovieRepeatModeOne;
self.moviePlayer.view.frame = self.container.frame;
self.moviePlayer.view.userInteractionEnabled = NO;
[self.container addSubview:self.moviePlayer.view];

- (NSURL*)getBundleClip:(NSString*)clip
{
    NSBundle *bundle = [NSBundle mainBundle];
    NSString *moviePath = [bundle pathForResource:clip ofType:@"mp4"];
    return [NSURL fileURLWithPath:moviePath];
}
.

繰り返しますが、Xcodeを4.5に更新する前に完全にプレイしました。他の誰かがこの問題を持っていますか?

私はこの出力を得る:

[MPAVController] Autoplay: Disabling autoplay for pause
[MPAVController] Autoplay: Disabling autoplay
.

役に立ちましたか?

解決

具体的に演奏していない理由はわかりませんが、どのバージョンのIOS SDKのバージョンに応じて行動が異なるように見えます。 MPMoviePlayerController Documentation

特に、Movie PlayerでprepareToPlayメソッドを呼び出してみてください。

他のヒント

関数内に定義したと思いますか?

ARCを使用している場合は、MPMOVIEPLAYERCONTROLLER を維持する必要があります。

インターフェイスファイルに追加します!

@property(nonatomic, strong) MPMoviePlayerController *moviePlayer;
.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top