0

I have two View controllers, in the firstViewController i wrote the code for MPMoviePlayerController and in the secondViewController also i wrote the same Code . then, only one MPMoviePlayerController is showing Video, But the other one is showing Black Screen.Even i Created one instance of MPMoviePlayerController for the both ViewController but Still did not work for me.

Here is the sample Code:

 myPlayer = [[MPMoviePlayerController alloc] init];
[myPlayer.view setFrame:CGRectMake(0, 0, 320, 393)]; 
myPlayer.shouldAutoplay = NO;
myPlayer.repeatMode = MPMovieRepeatModeNone;
myPlayer.fullscreen = YES;
myPlayer.movieSourceType = MPMovieSourceTypeStreaming;
myPlayer.scalingMode = MPMovieScalingModeAspectFit;
myPlayer.contentURL =theurl;
[self.view addSubview:myPlayer.view];

Please tell me, How to Play Video in both View Controllers?

Thank in Advance

4

1 回答 1

1

我的建议是,您应该创建一个视频视图控制器来播放视频,并且可以在需要时调用。

于 2012-10-16T12:06:51.113 回答