views:

170

answers:

1

Hi all! I need to play a video into a cocos2d project.. and my question is: how can I put MPMoviePlayerController into my view like this:?

UIView *theView = [[CCDirector sharedDirector] openGLView];

thanks very much!!

+1  A: 

You can't put controllers into views. However, you can put the views that they control into a view. Try this:

// instantiate and configure your MPMoviePlayerController here, c
// call it movieController

[theView addSubview:movieController.view];

disclaimer: I'm at the office so I have no way of knowing if this will work.

Kevin Hoffman