Hi Sirs!
We need to play some periods of the whole media,this means we need some kind of feature like this:
mLibVLC.play(starttime,endtime);
or:
mLibVLC.play(duration) for play a duration time from current postion then pause.BTW,it will be the best if these can be done in "synchronous" mode,this way we need not to add waiting logic by ourself.
For doing this,we need a open-only feature,but now,LibVLC can only open a media and play automaticly immediately useing readMedia(url),I have to stop or pause it immediately,BUT,unfortunately most of the operatings are not raliable,I mean libVLC.stop(),libVLC.pause(),even including libVLC.setVolume(),libVLC.setRate() very often can not work in the working thread( distinguishing the UI thread),I have to use the ugly looping code to check if they take effects,taking the risk of making ANR faults.
For example,some code like this:
mLibVLC.readMedia(mLocation,disvd);
while(mLibVLC.isPlaying()){
act.runOnUiThread(new Runnable() {
public void run() {
mLibVLC.stop();
}
});
}
Some time,mLibVLC.isPlaying() return false immediately after readMedia(),but it centainly actunally will play soon, no good way to control the condition.
Thank you very much!