Android MediaPlayer freezes after seeking a new video position -


i load .mp4 on videoview, things go fine until drag seekbar point new position, mediaplayer starts buffering , app freezes (not crash, freeze) error message:

"can't play video"

this code:

try {         // start mediacontroller         controller.setanchorview(videoview);         // url string videourl         uri video = uri.parse(getintent().getextras().getstring("video"));         videoview.setmediacontroller(controller);         videoview.setvideouri(video);      } catch (exception e) {         log.e("error", e.getmessage());         e.printstacktrace();     }      videoview.requestfocus();     videoview.setonpreparedlistener(new onpreparedlistener() {         // close progress bar , play video         public void onprepared(mediaplayer mp) {             pdialog.dismiss();             videoview.start();         }     }); 

no errors if seek already-buffered position. only no-buffered positions.

error log:

attempt perform seekto in wrong state: mplayer=0x5c149090, mcurrentstate=0 e/mediaplayer(17339): error (1, -110) e/mediaplayer(17339): error (1,-110) d/videoview(17339): error: 1,-110 


Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -