Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
New Contributor
proudchild
Posts: 7
Registered: ‎09-25-2012
My Device: Playbook 2.1
My Carrier: Claro

Re: Playing video with cocos2d-x (cocos2d-2.0-x-2.0.2) [SOLVED]

Hello!

 

I did the sanity check! And its confirmed that the video is playing, I put a video with sound... The sound goes on smoothly but I see a dark screen, which version of cocos2d-x are you using???

 

I'm using 2.0.3;

 

I'm checking further in the problem...

Please use plain text.
Contributor
chiguire
Posts: 23
Registered: ‎09-19-2012
My Device: BlackBerry PlayBook
My Carrier: Developer

Re: Playing video with cocos2d-x (cocos2d-2.0-x-2.0.2) [SOLVED]

I'm using 2.0.2, it shouldn't make too much difference. The dark screen is usually caused by the default drawing routing of cocos2d-x, that's why I override the draw() function, to clear the screen so the video can appear behind.

Please use plain text.
New Contributor
proudchild
Posts: 7
Registered: ‎09-25-2012
My Device: Playbook 2.1
My Carrier: Claro

Re: Playing video with cocos2d-x (cocos2d-2.0-x-2.0.2) [SOLVED]

Hello again,

 

I did an ultimate test, using cocos2d-x-2.0.2, sample video, and your code pure and simple in a new project...

It didn't work...


Black screen.

 

Are you sure you have not performed another modifications you didn't post here? I'm almost giving up the idea...

 

Is there a way to put the renderer above opengl window?

 

 

Please use plain text.
Contributor
chiguire
Posts: 23
Registered: ‎09-19-2012
My Device: BlackBerry PlayBook
My Carrier: Developer

Re: Playing video with cocos2d-x (cocos2d-2.0-x-2.0.2) [SOLVED]

I'm pretty sure I haven't added other modifications.

 

One thing, though: I had problems playing the video as the first scene (e.g. creating it directly from AppDelegate). I had to create a blank scene first whose only job is to replace the current scene in the director with the video scene. This is probably because the OpenGL initialization calls have not been made by the time the AppDelegate is creating the first scene.

 

Make sure that the video scene is not being created directly from the AppDelegate, but rather after another first scene.

 

Don't give up, you're very close to making it (I also had serious problems to play video on the Playbook, so I understand you completely)

Please use plain text.
New Contributor
germanmartinez
Posts: 5
Registered: ‎02-23-2012
My Device: playbook
My Carrier: 52614526141125867

Re: Playing video with cocos2d-x (cocos2d-2.0-x-2.0.2) [SOLVED]

Hi:

I know that this question has been posted since a long time ago, but I think that posting an answer will help someone else facing this same problem.

 

I was able to fix the issue by modifing the value of the screen transparency when configuring the window in the CCEGLView::initGL()  function

 

Change the value of

 

int screenTransparency = SCREEN_TRANSPARENCY_NONE;

 

to

 

int screenTransparency = SCREEN_TRANSPARENCY_SOURCE_OVER;

 

and after that compile and run your game and youll be able to watch the video on screen.

 

 

Please use plain text.