Is Video possible?

Hello there :slight_smile: .
I am porting a game from iphone IOS to Android using cpp and ndk. And now I am having problems showing movies. My questions are:

  1. Is it possible to show a movie from eg youtube from within your app? (As we use to do with a UIWebView? )
  2. Is it possible to show local movies eg .mov files from within your app? (As we use to do with eg MPMoviePlayerController? )

Any suggestions?
Regards, Esben

You can show local movie by invoking android sdk on java layer, and wrap the feature in JNI to make it visible in ndk layer. Just read the source in CocosDenshion/platform/android, it shows how to play audio with cocos2d-x.
About the online movie, I’m not sure if android already offer this feature, or you had to read streams from web, cache it and play. I am not familiar with this feature.

Hi, and sorry to add to an old thread, but this matches my issue really well. I took the next step and wrapped the call as the example in SimpleAudioEngine. I have the media player being called for a video and I can hear the audio, but the video doesn’t pop over the cocos2d scene. Does anyone know how to accomplish this? I already tried CCApplication::sharedApplication().applicationDidEnterBackground(), but that hasn’t allowed the video to pop over.

Thanks,
Jeff

Hello,
Did you set contentView?

setContentView(mVideoView);

I have opposite problem. I cant remove my mVideoView from Activity.

EDIT:
I found solution. If I use RelativeLayout to storing view, I am able to add and remove VideoView without problems.