Tuesday 15 January 2013

iphone - MPMoviePlayerController in background doesn't leave page when we change scene -


After

I use MPMoviePlayerController to play a video in the background of a CCMenu I'm code>. So I have a video behind some buttons. When I switch the scenes / scenes, I need movieplayer to leave the view / layer on the scene / layer similar to the picture.

In the background the code for playing the movie is as follows:

  - (zero) playMainMenuVideo {NSString * path = [[NSBundle mainBundle] pathForResource: "@ MYMMainMenu "OfType: @" mov "]; MPMoviePlayerViewController * Player = [[MPMoviePlayerViewController alloc] initWithContentURL: [NSURL fileURLWithPath: Path]]; Player Movie player. ControlStyle = MPVM control styling; [[Player of view] Setframe: [[CCCceterar shared director] scene] boundary]]; Player Movieplayer.crawlingmode = MPVScachingModeSpeechFile; [[[CCD Citizen Share Director] View] Adsview: [Player View]]; [[CCCCC director shared director] View] Sendubleback back: player. Weave]; UIView * glView = [CCDCD shared director] .view; // focus [glView.superview insertSubview: player.view atIndex: 0]; // focus glView.opaque = NO; // focus glClearColor (0.0f, 0.0f, 0.0f, 0.0f); // meditation}   

This works perfectly, even in app representative i

  CCGLVU * glView = [CCGLView viewWithFrame: [window_ bounds] pixelFormat : KEAGLColorFormatRGB565 // kEAGLColorFormatRGBA8   

Lastly I want to turn a page like a:

  [[CCDirector sharedDirector] replaceScene: [ CCTransitionPageTurn transitionWithDuration: 1.0 view: [first page view controller view]]];   

But only the phantom will leave the scene, the video keeps playing in the background. How do I fix it? Thanks in advance

I figured it out.

1) Notification of set up during video play. 2) When his game is played, keep an image of the last frame of the video on the video. 3) Then set these properties back to the original

  UIView * glView = [CCDirector sharedDirector] .view; // focus glView.opaque = yes; // focus glClearColor (0.0f, 0.0f, 0.0f, 1.0f);   

4) MPMoviePlayerController

Happy coding remove everyone):

No comments:

Post a Comment