Playing video files

The cutscene is a concept that has existed since the early days of video games. Cutscenes are usually interspersed in between gameplay segments or shown when a game is loading. For more complex cutscenes it is often advantageous to use full motion video. In this recipe we will see how to insert a video into our game.

Playing video files

Getting ready

Please refer to the project RecipeCollection01 for full working code of this recipe.

How to do it...

This recipe requires the extra step of linking the MediaPlayer iOS framework to our project:

  1. Right-click your project under Groups & Files.
  2. Click Add | Existing Frameworks
  3. Under iOS SDK select MediaPlayer.framework ...

Get Cocos2d for iPhone 1 Game Development Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.