1

I have "imported" the extension "CCVideoPlayer" to my cocos2d project and I would like to use it in order to show a video splash screen before my game starts (I know many people hate it, but I don't care). However, there are not as many tutorials on the Internet, so you guys are pretty much my last resort. I have copied my Video - a 1280 x 720 Quicktime Movie (671 MB) - into my project properly and when I call:

   [CCVideoPlayer setDelegate:self];
   [CCVideoPlayer playMovieWithFile:@"Main.mov"];

I see a black screen and the sound of the movie plays correctly, however there is no video. So what should I do ?

Side note: I have implemented the delegate methods and my class adheres to the CCVideoPlayerDelegate.

Guru
  • 21,652
  • 10
  • 63
  • 102
the_critic
  • 12,720
  • 19
  • 67
  • 115

1 Answers1

1

You may add video splash screen by simply using objective-c code also.

1st- import MediaPlayer framework 2nd-in .h file #import

in any method of .m file-

{
NSString *path=[[NSBundle mainBundle] 
                    pathForResource:@"videoName" ofType:@"mov"]; //only .mov file can run here

   MPMoviePlayerViewController * player=[[MPMoviePlayerViewController alloc]
            initWithContentURL:[NSURL  fileURLWithPath:path]];

    [ self  presentMoviePlayerViewControllerAnimated: player];
}
stack
  • 951
  • 3
  • 9
  • 23