Standard Videoview Playback Example
This address: Http://blog.csdn.net/caroline_wendy
Within the Apidemos of the Android SDK , the code for the standard playback video is provided, using Videoview for simple video playback functions.
The code is as follows:
public class Videoviewdemo extends Activity { /** * Todo:set The PATH variable to a streaming video URL or a loca L Media * file path. */ private videoview Mvideoview; @Override public void OnCreate (Bundle icicle) { super.oncreate (icicle); Setcontentview (R.layout.videoview); Mvideoview = (videoview) Findviewbyid (R.id.surface_view); /* * Alternatively, can use Mvideoview.setvideopath (<path>); */ Mvideoview.setvideouri (Uri.parse ("android.resource://" + getpackagename () + "/" + R.raw.videoviewdemo) ); Mvideoview.setmediacontroller (New Mediacontroller (this)); Mvideoview.requestfocus (); }}
Android-Standard Videoview Playback Example