I have build an app that has videos in it that stream from the Internet and I'm not very impressed with the performance of them. Would anyone like to share the code for loading videos from the SD card.
Thanks
See Question&Answers more detail:osI have build an app that has videos in it that stream from the Internet and I'm not very impressed with the performance of them. Would anyone like to share the code for loading videos from the SD card.
Thanks
See Question&Answers more detail:osI hope this code help u
public class video extends Activity{
VideoView video_view;
String ex_name;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.eccryption);
video_view = (VideoView) findViewById(R.id.videoView1);
ex_name = getIntent().getExtras().getString("video_name");
MediaController mediaController = new MediaController(this);
mediaController.setAnchorView(video_view);
video_view.setMediaController(new MediaController(this));
handler.sendEmptyMessage(1);
}
Handler handler = new Handler(){
public void handleMessage(Message msg){
int pos=msg.what;
if (pos == 1){
video_view.setVideoPath(Environment.getExternalStorageDirectory()+"/"+ex_name+".mp4");
video_view.requestFocus();
video_view.start();
Log.d("Before Video Finish", "i m in before video finish");
video_view.setOnCompletionListener(new OnCompletionListener() {
@Override
public void onCompletion(MediaPlayer mp) {
finish();
}
});
}
}
};
Use this Code This Code,My dear friends !