Android plays video with its own Videoview control
Activity
The public class Activity01 extends activity {/** called the ' when ' is the ' The activity ' is the ' the '---' @Override
public void OnCreate (Bundle savedinstancestate) {super.oncreate (savedinstancestate);
Setcontentview (R.layout.main);
Final Videoview Videoview = (videoview) Findviewbyid (R.ID.VIDEOVIEW01);
Button Pausebutton = (button) This.findviewbyid (R.id.pausebutton);
Button Loadbutton = (button) This.findviewbyid (R.id.loadbutton);
Button PlayButton = (button) This.findviewbyid (R.id.playbutton);
Load Loadbutton.setonclicklistener (new Onclicklistener () {public void OnClick (View arg0)
{//Videoview.setvideopath ("/sdcard/test.mp4");
Videoview.setvideopath ("android.resource://com.homer/" +r.raw.china); Videoview.setmediacontroller (New Mediacontroller (Activity01.this));
Videoview.requestfocus ();
}
});
Play Playbutton.setonclicklistener (new Onclicklistener () {public void OnClick (View arg0)
{Videoview.start ();
}
});
Pause Pausebutton.setonclicklistener (New Onclicklistener () {public void OnClick (View arg0)
{Videoview.pause ();
}
}); }
}