0

私はビデオを再生するために次のコードを使用しています。実際にはとてもうまくいきます。 時々私は次のエラーを受け取ります - [AVFileValidator fpItemNotificationInfo:]:認識できないセレクターがインスタンス0x8114e50に送られました。私がこれについて調べたとき、私はメディアプレーヤーのプライベートセクションに達しました。私はそれが本当に何を意味するのか分からなかった。誰かが答えを知っていれば助けてください。- [AVFileValidator fpItemNotificationInfo:]:インスタンスに送信された認識できないセレクタ0x8114e50

-(void)playerPrepare 
{ 

    player.view.frame = CGRectMake(0.0f, 0.0f, 480.0f, 320.0f); 

    [self.view addSubview:player.view]; 

    [player setControlStyle:MPMovieControlStyleNone]; 

    [player play]; 

} 

-(void)breadInPlate 
{ 
    // Do any additional setup after loading the view from its nib. 
    NSString *url = [[NSBundle mainBundle] pathForResource:@"10_Anim_iPhone" 
                ofType:@"mp4"]; 

    NSURL *movieURL = [NSURL fileURLWithPath:url]; 



    player = [[MPMoviePlayerController alloc] 
       initWithContentURL:movieURL]; 




    [[NSNotificationCenter defaultCenter] 
    addObserver:self 
    selector:@selector(movieFinishedCallback:)             
    name:MPMoviePlayerPlaybackDidFinishNotification 
    object:player]; 

    [player prepareToPlay]; 

    [self performSelector:@selector(playerPrepare) withObject:nil afterDelay:0.5]; 

    breadTimer = nil; 

} 

-(void)viewDidLoad 
{ 
breadTimer = [NSTimer scheduledTimerWithTimeInterval:0.1 target:self selector:@selector(breadInPlate) userInfo:nil repeats:NO]; 
} 

- (void) movieFinishedCallback:(NSNotification*) aNotification { 
    player = [aNotification object]; 
    [[NSNotificationCenter defaultCenter] 
    removeObserver:self 
    name:MPMoviePlayerPlaybackDidFinishNotification 
    object:player];  


    [player.view removeFromSuperview]; 
    [player release]; 
    player = nil; 


} 

時折コードを実行しているうちに、次のエラーが表示されます。

-[AVFileValidator fpItemNotificationInfo:]: unrecognized selector sent to instance 0x8114e50 
2011-10-20 14:48:16.754 PansjoPictureBook[1596:307] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[AVFileValidator fpItemNotificationInfo:]: unrecognized selector sent to instance 0x8114e50' 
*** Call stack at first throw: 
(
    0 CoreFoundation      0x33ac0987 __exceptionPreprocess + 114 
    1 libobjc.A.dylib      0x3347b49d objc_exception_throw + 24 
    2 CoreFoundation      0x33ac2133 -[NSObject(NSObject) doesNotRecognizeSelector:] + 102 
    3 CoreFoundation      0x33a69aa9 ___forwarding___ + 508 
    4 CoreFoundation      0x33a69860 _CF_forwarding_prep_0 + 48 
    5 CoreFoundation      0x33a5ebbf -[NSObject(NSObject) performSelector:withObject:] + 22 
    6 Celestial       0x33c9e309 -[AVObjectRegistry safeInvokeWithDescription:] + 124 
    7 CoreFoundation      0x33a5ebbf -[NSObject(NSObject) performSelector:withObject:] + 22 
    8 Foundation       0x33639795 __NSThreadPerformPerform + 268 
    9 CoreFoundation      0x33a767dd __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 12 
    10 CoreFoundation      0x33a485b7 __CFRunLoopDoSources0 + 382 
    11 CoreFoundation      0x33a47e5b __CFRunLoopRun + 230 
    12 CoreFoundation      0x33a47c87 CFRunLoopRunSpecific + 230 
    13 CoreFoundation      0x33a47b8f CFRunLoopRunInMode + 58 
    14 GraphicsServices     0x33b0e4ab GSEventRunModal + 114 
    15 GraphicsServices     0x33b0e557 GSEventRun + 62 
    16 UIKit        0x32099329 -[UIApplication _run] + 412 
    17 UIKit        0x32096e93 UIApplicationMain + 670 
    18 PansjoPictureBook     0x0000224f main + 82 
    19 PansjoPictureBook     0x000021f8 start + 40 
) 
terminate called after throwing an instance of 'NSException' 

答えて

0

このエラーを回避します。 mpmovieplayerがすでに再生中であることを確認してください。それが再生されている場合は、それをリリースしてから、最初のプレーヤーのリラックスが2番目のプレーヤーを再生する要求を送信した後にしてください。

関連する問題