cocos2d::experimental::ui::VideoPlayer not working on android

Here is my code below:

     videoPlayer = cocos2d::experimental::ui::VideoPlayer::create();
     videoPlayer->setContentSize(Size(visibleSize.width, visibleSize.width*1.778));
     videoPlayer->setAnchorPoint(cocos2d::Vec2::ANCHOR_MIDDLE);
     videoPlayer->setPosition(Size(visibleSize.width/2, visibleSize.height/2));
     videoPlayer->setFileName("LOGO/test.mp4");
     addChild(videoPlayer, 25);
     videoPlayer->play();

It works flawlessly on iOS but on Android I get this error:

MediaPlayer             stop called in state 1
MediaPlayer             error (-38, 0)

I tried this below in my onCreate method in AppActivity:

       mediaplayer.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
	  @Override
	  public void onPrepared(MediaPlayer mp) {
	      mp.start();
	  }
	});
    mediaplayer.prepareAsync();

But I am getting:

 Attempt to invoke virtual method 'void android.media.MediaPlayer.setOnPreparedListener(android.media.MediaPlayer$onPreparedListener)' on null object reference

Edit: I changed my AppActivity to:

 public class AppActivity extends Cocos2dxActivity implements  MediaPlayer.OnPreparedListener {

 private MediaPlayer player;

 @Override
  protected void onCreate(Bundle savedInstanceState) {
// Your own code to create the view
// ...
super.onCreate(savedInstanceState);

player = MediaPlayer.create(this, R.raw.test);
player.setOnPreparedListener(this);

...

 @Override
  public void onPrepared(MediaPlayer mediaPlayer) {
  //playButton.setEnabled(true);
  //canMakeCall = true;
  player.start();

}

I get audio now but still get the:

MediaPlayer-JNI         QCMediaPlayer mediaplayer NOT present
MediaPlayer             Should have subtitle controller already set
MediaPlayer             stop called in state 1
MediaPlayer             error (-38, 0)

@nite @SonarSystems @zhangxm can you shed some light here? I was just thinking that my video file may be too big to be prepared properly. Since I scale it after the fact. Thanks

Video specs
Dimensions: 750x1334
Duration: 7 seconds
777KB

cocos2d version: 3.6
android test device version: 4.4.4

It shouldn’t be too big. Are you having any problems during testing?

@SonarSystems hey thanks for the reply. Yeah I posted my code and the errors in this topic thread. Basically I can’t get the cocos2dx videoplayer to work for android. I am using your tutorial for the videoplayer as well.

@slackmoehrle I noticed you were helping a few others with this issue. Do you have any suggestions?

I know video player was new around the v3.6 timeframe. We could try this code in v3.13.1 and see if it works. I have a few Android devices to test with.

Yeah sure thanks a lot. I am worried updating will mess up my project since I just got everything working on both platforms. But I also have read that people got the videoplayer to work on android with older versions than 3.6 so that’s why I am confused.

This is what I have found so far using JNI calls but I was hoping there was an easier way now.

@slackmoehrle any luck?

I got it to work on v3.13.1

In my testing it works in recent versions, 3.10+