java - Android mp4 videos doesn't play in Emulator as well as device -


i want stream mp4 videos android phone in android app. videos stored in server. have url's. tried code below, didn't play videos (it worked fine .3gp videos on both emulator , device) i'm using galaxy y hardware , emulator 4.2 version of android. please don't refer me links, did lot of searching of got in vain. can't use webview, have use videoview in app. code is:

private void playvideo() {      try {      final string path = mpath.gettext().tostring();         log.v(tag, "path: " + path);         if (path == null || path.length() == 0) {             toast.maketext(mainactivity.this, "file url/path empty",                     toast.length_long).show();      } else {             // if path has not changed, start media player             if (path.equals(current) && mvideoview != null) {                 mvideoview.start();                 mvideoview.requestfocus();                 return;             }             current = path;             mvideoview.setvideopath(getdatasource(path));             mvideoview.start();             mvideoview.requestfocus();          }     } catch (exception e) {         log.e(tag, "error: " + e.getmessage(), e);         if (mvideoview != null) {             mvideoview.stopplayback();         }     } } 

where path initialized link:

path = http://download.itcuties.com/teaser/itcuties-teaser-480.mp4

any highly appreciated.


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -