android - Playing Video dosnt work -


i wont play video in application ... write code below:

import android.os.bundle;   import android.app.activity;  import android.view.menu;  import android.widget.textview;  public class mainactivity extends activity {      public textview counter = null;      @override     protected void oncreate(bundle savedinstancestate) {         super.oncreate(savedinstancestate);     setcontentview(r.layout.welcomepage);     videoview = (videoview)findviewbyid(r.id.videoview);      log.e("ok","ok");     videoview.setvideopath("animationgif/vid.flv");     videoview.start();  } } 

but doesnt work !!! have solution plz !

in order set video external storage (sdcard or phone):

videoview.setvideopath(environment.getexternalstoragedirectory()+"/folder/file.mp4"); 

to raw folder:

videoview.setvideouri(uri.parse("android.resource://" + getpackagename() +"/"+r.raw.video)); 

android doesn't support flv. supports mp4 , 3gp (mkv starting android 4.0). see link supported media formats http://developer.android.com/guide/appendix/media-formats.html.


Comments

Popular posts from this blog

java - Run a .jar on Heroku -

java - Jtable duplicate Rows -

validation - How to pass paramaters like unix into windows batch file -