Android : Vitamio library: video and audio out of sync

on Thursday, April 2, 2015


I have included the VitamioBundle library into my project. It plays videos, but the problem is that the video and the audio are out of sync. How can i solve this issue?


Here is my code.



Vitamio.initialize(VideoPlayer.this);
if (!io.vov.vitamio.LibsChecker.checkVitamioLibs(this))
return;
videoView = (VideoView) findViewById(R.id.VideoView);
videoView.setOnErrorListener(new OnErrorListener() {
public boolean onError(MediaPlayer mp, int what, int extra) {
return true;
}
});
videoView.setVideoChroma(MediaPlayer.VIDEOCHROMA_RGB565);
videoView.setHardwareDecoder(true);
videoView.setVideoQuality(VIDEOQUALITY_HIGH);
videoView.setOnPreparedListener(new OnPreparedListener() {
@Override
public void onPrepared(MediaPlayer mediaPlayer) {
mediaPlayer.setPlaybackSpeed(1.0f);
mediaPlayer.setAdaptiveStream(true);

}
});
videoView.setVideoPath(vlink);
videoView.requestFocus();

videoView.setVideoLayout(VideoView.VIDEO_LAYOUT_SCALE, 0);
videoView.setOnPreparedListener(new OnPreparedListener() {

public void onPrepared(MediaPlayer mp) {
videoView.start();

}
});

0 comments:

Post a Comment