@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.music);
start = (Button) findViewById(R.id.button1);
stop = (Button) findViewById(R.id.button2);
view = (VideoView) findViewById(R.id.videoView1);
Uri uri = Uri.parse("android.resource://" + getPackageName()
+ "rii.mp4");
controller = new MediaController(this);
view.setMediaController(controller);
view.setVideoURI(uri);
// songobj =MediaPlayer.create(music.this,R.raw.zs);
start.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// songobj.start();
view.start();
// Toast.makeText(getApplicationContext(),
// "save",Toast.LENGTH_LONG).show();
}
});
stop.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// songobj.release();
// songobj.pause();
view.pause();
}
});
}
我在原始文件夹中的视频。请告诉我答案我想在视频视图中播放视频。当我运行活动时,它会给出不支持格式的错误。我已经将格式更改为 android mp4 格式。