Does VideoPlayer class works for android?

I want to play mp4 (h264) video on cocos2dx project at android (5-6).
My code:
#include <ui/UIVideoPlayer.h>

#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)

player = experimental::ui::VideoPlayer::create();
player->setFileName("video/h264_codec.mp4");
player->setPosition(mCenter);
    player->play();
this->addChild(player);

#endif

At run it gives me folowing exception:

05-04 10:59:11.489 12979 12995 F art     : art/runtime/java_vm_ext.cc:410] JNI DETECTED ERROR IN APPLICATION: JNI NewStringUTF called with pending exception java.lang.NullPointerException: Attempt to invoke virtual method 'boolean org.cocos2dx.lib.Cocos2dxVideoHelper$VideoHandler.sendMessage(android.os.Message)' on a null object reference
05-04 10:59:11.489 12979 12995 F art     : art/runtime/java_vm_ext.cc:410]   at int org.cocos2dx.lib.Cocos2dxVideoHelper.createVideoWidget() (Cocos2dxVideoHelper.java:203)
05-04 10:59:11.489 12979 12995 F art     : art/runtime/java_vm_ext.cc:410]   at void org.cocos2dx.lib.Cocos2dxRenderer.nativeInit(int, int) (Cocos2dxRenderer.java:-2)
05-04 10:59:11.489 12979 12995 F art     : art/runtime/java_vm_ext.cc:410]   at void org.cocos2dx.lib.Cocos2dxRenderer.onSurfaceCreated(javax.microedition.khronos.opengles.GL10, javax.microedition.khronos.egl.EGLConfig) (Cocos2dxRenderer.java:72)
05-04 10:59:11.489 12979 12995 F art     : art/runtime/java_vm_ext.cc:410]     from void org.cocos2dx.lib.Cocos2dxRenderer.nativeInit(int, int)
05-04 10:59:11.489 12979 12995 F art     : art/runtime/java_vm_ext.cc:410]   native: #07 pc 00324058  /data/app/org.charge.clustertest-2/lib/arm/libcocos2dcpp.so (_ZN7_JNIEnv12NewStringUTFEPKc+40)
05-04 10:59:11.489 12979 12995 F art     : art/runtime/java_vm_ext.cc:410]   native: #08 pc 0032f7cc  /data/app/org.charge.clustertest-2/lib/arm/libcocos2dcpp.so (_Z11_getClassIDPKc+60)
05-04 10:59:11.489 12979 12995 F art     : art/runtime/java_vm_ext.cc:410]   native: #09 pc 0032fe38  /data/app/org.charge.clustertest-2/lib/arm/libcocos2dcpp.so (_ZN7cocos2d9JniHelper19getStaticMethodInfoERNS_14JniMethodInfo_EPKcS4_S4_+136)
05-04 10:59:11.489 12979 12995 F art     : art/runtime/java_vm_ext.cc:410]   native: #10 pc 00362f68  /data/app/org.charge.clustertest-2/lib/arm/libcocos2dcpp.so (_ZN7cocos2d9JniHelper20callStaticVoidMethodIJiiNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEEEEvRKS8_SA_DpT_+776)
05-04 10:59:11.489 12979 12995 F art     : art/runtime/java_vm_ext.cc:410]   native: #11 pc 00360ee0  /data/app/org.charge.clustertest-2/lib/arm/libcocos2dcpp.so (_ZN7cocos2d12experimental2ui11VideoPlayer11setFileNameERKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEE+820)
05-04 10:59:11.489 12979 12995 F art     : art/runtime/java_vm_ext.cc:410]   native: #12 pc 0023006c  /data/app/org.charge.clustertest-2/lib/arm/libcocos2dcpp.so (_ZN9MainScene4initEv+8804)
05-04 10:59:11.489 12979 12995 F art     : art/runtime/java_vm_ext.cc:410]   native: #13 pc 0022cb5c  /data/app/org.charge.clustertest-2/lib/arm/libcocos2dcpp.so (_ZN9MainScene6createEv+112)
05-04 10:59:11.489 12979 12995 F art     : art/runtime/java_vm_ext.cc:410]   native: #14 pc 0022d5ec  /data/app/org.charge.clustertest-2/lib/arm/libcocos2dcpp.so (_ZN9MainScene11createSceneEv+24)
05-04 10:59:11.489 12979 12995 F art     : art/runtime/java_vm_ext.cc:410]   native: #15 pc 00212ac0  /data/app/org.charge.clustertest-2/lib/arm/libcocos2dcpp.so (_ZN11AppDelegate29applicationDidFinishLaunchingEv+1248)
05-04 10:59:11.489 12979 12995 F art     : art/runtime/java_vm_ext.cc:410]   native: #16 pc 0032193c  /data/app/org.charge.clustertest-2/lib/arm/libcocos2dcpp.so (_ZN7cocos2d11Application3runEv+40)
05-04 10:59:11.489 12979 12995 F art     : art/runtime/java_vm_ext.cc:410]   native: #17 pc 0032c4f0  /data/app/org.charge.clustertest-2/lib/arm/libcocos2dcpp.so (Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeInit+216)
05-04 10:59:11.489 12979 12995 F art     : art/runtime/java_vm_ext.cc:410]   native: #18 pc 000c4a3d  /data/app/org.charge.clustertest-2/oat/arm/base.odex (void org.cocos2dx.lib.Cocos2dxRenderer.nativeInit(int, int)+80)
05-04 10:59:11.489 12979 12995 F art     : art/runtime/java_vm_ext.cc:410]   native: #19 pc 000c5a87  /data/app/org.charge.clustertest-2/oat/arm/base.odex (void org.cocos2dx.lib.Cocos2dxRenderer.onSurfaceCreated(javax.microedition.khronos.opengles.GL10, javax.microedition.khronos.egl.EGLConfig)+74)
05-04 10:59:11.489 12979 12995 F art     : art/runtime/java_vm_ext.cc:410]   at org.cocos2dx.lib.Cocos2dxRenderer.nativeInit(Native method)
05-04 10:59:11.489 12979 12995 F art     : art/runtime/java_vm_ext.cc:410]   at org.cocos2dx.lib.Cocos2dxRenderer.onSurfaceCreated(Cocos2dxRenderer.java:72)

What can I do about it? Does it works with android? Is there any code samples?

Why you depends on Activity in VideoPlayer class?

My whole cocos2dx project can live inside Service and render to views, not connected to any Activities (and there is some cases, when its the only options). The only things VideoPlayer class need is some Context and SurfaceView.

Another question about VideoPlayer.

If video completelly played, how to play it again? I tried to call play() … seekTo(0) and play… no use.

@owlet you can refer to cocos2d-x/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIVideoPlayerTest/UIVideoPlayerTest.cpp.

I see a image glitch when play() after completed (at my test project as well as at cpp test). Is there anything I can do about it or why it happens? And any advices about how to use player class at project without activity (whole cocos project runs inside android service)?

I asked @owen to take a look.