0

I am currently working on an app in which I need to play a video. Everything is working fine. But if my application is sent to the background and then again to the foreground it shows a solid black screen.

Please provide me with a solution to this problem.

    [player.view setFrame:CGRectMake(0, 0, 480, 278)];
    [player.view setAutoresizingMask:UIViewAutoresizingFlexibleWidth];
    outputURL = [NSURL fileURLWithPath:filePath];
    [player setContentURL:outputURL];
    [player setShouldAutoplay:NO];
    player.repeatMode = MPMovieRepeatModeNone;
    player.controlStyle =  MPMovieControlStyleNone ;

    player.scalingMode = MPMovieScalingModeAspectFit;

    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moviePlayBackDidFinish) name:MPMoviePlayerPlaybackDidFinishNotification object:player];
    [player prepareToPlay];
    [player pause];
    [self.view addSubview: player.view];
4

1 回答 1

0

只需查看此解决方案 对于 MPMoviePlayer

于 2013-01-17T12:36:55.420 回答