COCOS2DX iOS video player 2.x to 3.x versions are available

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.