Cant using VideoPlayer - Cocos2d-x v4

Hello everyone, im tring to play video using cocos2d::ui::VideoPlayer in windows and android. but unfortunately, VideoPlayer is not found. i’ve look on cpp test and try to coppied them to my code. but stil, VideoPlayer is undefined.

i dont know how its happen, here my code.


#include "cocos2d.h"
#include "extensions/cocos-ext.h"
#include "ui/CocosGUI.h"
using namespace ui;
#include "extensions/cocos-ext.h"
#include "editor-support/cocostudio/CCSGUIReader.h"

class MyGame: public Layer
cocos2d::ui::VideoPlayer* _video;


_video = VideoPlayer::create();
_video->setPosition(Vec2(512, 384));
_video->setContentSize(Size(960, 640));



in my visual studio 2017, VideoPlayer is undefined. its like not found in cocos file. or, Anyway to play video in cocos2dx v4 ? Thanks.

This only available for Android & iOS.
Windows its not supported.

1 Like

Hi @smitpatel88, thanks for the answer.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.