I have downloaded a video from VideoView. Video works fine, but not displayed on the screen.
Other question is, if I use .3gp videos then it works fine , but if I use .mp4 vidoes then it slows down.
Below is my code :
public class MyActivity extends Activity implements View.OnClickListener {
/**
* Called when the activity is first created.
*/
public Button btn;
public VideoView vv;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
btn = (Button) findViewById(R.id.button);
btn.setOnClickListener(this);
vv = (VideoView) findViewById(R.id.videoView);
}
@Override
public void onClick(View v) {
switch(v.getId()){
case R.id.button:
vv.setVideoURI(Uri.parse("http://m.ochepyatki.ru/video.php?vkey=6991aa4&f=21395228200"));
vv.setMediaController(new MediaController(this));
vv.requestFocus(0);
vv.start();
break;
}
}
}