The following steps are required to use the video player in the COCOS2DX version
1, in writing a. mm file my mm here is called Iosplayvedio this
Header file defines this
static void Playonlinevideo4ios (char *pszvideourl);
. mm Inside Write
void Iosplayvedio::p layonlinevideo4ios (char *pszvideourl)
{
NSString * Strvideo = [NSString Stringwithutf8string:pszvideourl];
AppController *app = (appcontroller*) [[UIApplication sharedapplication] delegate];
[App Playmovie:strvideo];
}
2,AppController Write a method
-(void) Playvedio: (NSString *) videofile;
-(void) Playmovie: (NSString *) str{
Nsurl *url = [Nsurl urlwithstring:str];
Movieplayerviewcontroller *MOVIEVC = [[Movieplayerviewcontroller alloc]initnetworkmovieplayerviewcontrollerwithurl : URL movietitle:@ "da da Network"];
Movievc.datasource = self;
[Viewcontroller PRESENTVIEWCONTROLLER:MOVIEVC Animated:no Completion:nil];
}
iOS code in the following iOS programmer Open Source Direct View Source code
Called in the COCOS2DX.
Pcoursewareinformation->themeresources_video_url//inside is the address of the video
Code
Http://www.sundaboke.com/video.rar
COCOS2DX iOS video player 2.x to 3.x versions are available