【发布时间】:2013-01-17 12:28:02
【问题描述】:
我目前正在开发一个需要在其中播放视频的应用。一切正常。但是如果我的应用程序被发送到后台,然后又被发送到前台,它会显示一个纯黑屏幕。
请给我一个解决这个问题的方法。
[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];
【问题讨论】:
-
粘贴你尝试过的代码
-
张贴你的代码老兄!如果没有看到您的代码,我们就无法看到您所做的事情!
-
@NitinGohel 停止在帖子中编辑随机代码标签。
标签: iphone objective-c ios6 media-player