我目前正在开发一款需要播放视频的应用。一切都很好。但是如果我的应用程序被发送到后台然后再次发送到前台,它会显示一个黑色的固定屏幕。
请为我提供解决此问题的方法。
[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];