FileDocCategorySizeDatePackage
VideoViewDemo.javaAPI DocAndroid 1.5 API1430Wed May 06 22:41:08 BST 2009com.example.android.apis.media

VideoViewDemo

public class VideoViewDemo extends android.app.Activity

Fields Summary
private String
path
TODO: Set the path variable to a streaming video URL or a local media file path.
private android.widget.VideoView
mVideoView
Constructors Summary
Methods Summary
public voidonCreate(android.os.Bundle icicle)


    
        
        super.onCreate(icicle);
        setContentView(R.layout.videoview);
        mVideoView = (VideoView) findViewById(R.id.surface_view);

        if (path == "") {
            // Tell the user to provide a media file URL/path.
            Toast.makeText(
                    VideoViewDemo.this,
                    "Please edit VideoViewDemo Activity, and set path"
                            + " variable to your media file URL/path",
                    Toast.LENGTH_LONG).show();

        } else {

            /*
             * Alternatively,for streaming media you can use
             * mVideoView.setVideoURI(Uri.parse(URLstring));
             */
            mVideoView.setVideoPath(path);
            mVideoView.setMediaController(new MediaController(this));
            mVideoView.requestFocus();

        }