views:

37

answers:

1

public class MainActivity extends Activity{

MediaController mediaController;
MediaPlayer mp;

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
    // Uri uri = Uri.parse("android.resource//org.me.vid_sample/raw/lahainaharbor");

    File path = new File("/sdcard/Waileasuntest1.mp4");
    VideoView videoView = (VideoView) findViewById(R.id.surface);
    videoView.setVideoPath(path.getAbsolutePath());
    mediaController = new MediaController(this);
    mediaController.setMediaPlayer(videoView);
    mediaController.setAnchorView(videoView);
    videoView.setMediaController(mediaController);
    videoView.requestFocus();
    videoView.start();

}
A: 

check in device.. i am sure it works..

XXXXXX