2011-07-22 20 views
0

私はMPMoviePlayerControllerに多くの問題があります。iphone/ipadのMPMoviePlayerControllerで作業中に問題が発生する

ビデオを通常の画面からフルスクリーンに切り替えると、1つのバーが表示されます。そこには、前進/後退/一時停止のためのボタンがありますが、それらのボタンは私の要求に応じて正しく動作しません。すなわち、順方向/巻き戻しボタンを1回クリックするだけで、次/前のビデオは変化しません。 MPMoviePlayerControllerはそのクリックで停止します。

ありがとうございます。

答えて

0

通知の登録を試してください。

MPMoviePlaybackState 
Constants describing the current playback state of the movie player. 

enum { 
    MPMoviePlaybackStateStopped, 
    MPMoviePlaybackStatePlaying, 
    MPMoviePlaybackStatePaused, 
    MPMoviePlaybackStateInterrupted, 
    MPMoviePlaybackStateSeekingForward, 
    MPMoviePlaybackStateSeekingBackward 
}; 
typedef NSInteger MPMoviePlaybackState; 
0

この

-(void)videoClick:(id)sender 
{ 
    bi3.enabled=NO; 
    videoTable = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, 768, 1024)]; 
    videoTable.dataSource = self; 
    videoTable.delegate = self; 
    videoTable.rowHeight=100; 
    videoTable.separatorStyle=UITableViewCellSeparatorStyleSingleLine; 
    videoTable.separatorColor=[UIColor brownColor]; 
    navTitleLabel.text = [NSString stringWithFormat:@"xxx"]; 
    [webView addSubview:videoTable]; 

} 

-(void)videoFile:(NSString *)moviepath 
{ 

    //[tools setHidden:YES]; 
// bi3.enabled=NO; 

    // Register to receive a notification when the movie scaling mode has changed. 


    //NSString *moviePath = [bundle pathForResource:@"video" ofType:@"mp4"]; 
    NSURL *movieURL1 = [[NSURL fileURLWithPath:moviepath] retain]; 
    MPMoviePlayerController *theMovie = [[MPMoviePlayerController alloc] initWithContentURL:movieURL1]; 
    [theMovie setControlStyle:MPMovieControlStyleFullscreen]; 
    [theMovie play]; 
    MPMoviePlayerViewController *moviePlayer11 = [[MPMoviePlayerViewController alloc] initWithContentURL:movieURL1]; 
    [self presentMoviePlayerViewControllerAnimated:moviePlayer11]; // Override point for customization after app launch  
    // [navigationController.view addSubview:]; 
    //[self.view addSubview:mpMCtr.view]; 



} 
- (void) movieFinishedCallback:(NSNotification*) aNotification { 
    bi3.enabled=YES; 
    [tools setHidden:NO]; 
    MPMoviePlayerController *player = [aNotification object]; 
    [[NSNotificationCenter defaultCenter] 
    removeObserver:self 
    name:MPMoviePlayerPlaybackDidFinishNotification 
    object:player]; 
    // [player stop]; 
    //[self.view removeFromSuperview]; 
[player.view removeFromSuperview]; 

     [player autorelease];  
} 

- (void) moviePlayBackDidFinish:(NSNotification*)aNotification 
{ 

    MPMoviePlayerController* theMovie=[aNotification object]; 
    [[NSNotificationCenter defaultCenter] removeObserver:self 
                name:MPMoviePlayerPlaybackDidFinishNotification 
                object:theMovie]; 
    //[mpMCtr stop]; 

    [theMovie.view removeFromSuperview]; 
    [videoTable removeFromSuperview]; 

} 
-(void)backview:(id)sender 
{ 
    [mpMCtr stop]; 
    [mpMCtr.view removeFromSuperview]; 
    [videoTable removeFromSuperview]; 
    [self.navigationController popViewControllerAnimated:YES]; 
} 
好きです
関連する問題