Desember 01, 2012
By
Firman
- Download cocos2d extension from: https://github.com/cocos2d/cocos2d-iphone-extensions
- Unzip, navigate into the directory: extensions -> CCVideoPlayer.
- Copy file CCVideoPlayer.h and CCVideoPlayer.m and the folder iOS.
- Insert them anywhere in the project.
- In CCVideoPlayer.m, comment out the line #import "CCVideoPlayerImplMac.h"
- Done! To play video, simply do: [CCVideoPlayer playMovieWithFile:@"filename.mp4"]
- You can set a delegate to the CCVideoPlayer by implementing protocol: <CCVideoPlayerDelegate>
- The protocol will call method:
-(void) movieStartsPlaying
when the movie starts
and
-(void) moviePlaybackFinished
when the movie finishes.
0 komentar:
Posting Komentar