android - Vitamio media player onCompletion Listner not called -
i using vitamio sdk have written code below oncompletion listener not called.
mediaplayer = new mediaplayer(this); utils.showlog(tag, "alert video path play : " + path); mediaplayer.setdatasource(path); mediaplayer.setdisplay(sholder); mediaplayer.setbuffersize(1024 * 256); mediaplayer.prepareasync(); mediaplayer.setwakemode(getapplicationcontext(), powermanager.partial_wake_lock); mediaplayer.setonpreparedlistener(this); mediaplayer.setonerrorlistener(this); mediaplayer.setonvideosizechangedlistener(this); mediaplayer.setoninfolistener(this);
and set oncompletion listener after start of video
mediaplayer.setoncompletionlistener(this);
setoncompletionlistener
on videoview
instead of mediaplayer
.
videoview.setoncompletionlistener(new mediaplayer.oncompletionlistener() { @override public void oncompletion(mediaplayer mp) { videoplayeractivity.this.finish(); } });
update
i think problem imports. double check following import.
import io.vov.vitamio.mediaplayer.oncompletionlistener;
Comments
Post a Comment