1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
/***
* Excerpted from "Hello, Android! 2e",
* published by The Pragmatic Bookshelf.
* Copyrights apply to this code. It may not be used to create training material,
* courses, books, articles, and the like. Contact us if you are in doubt.
* We make no guarantees that this code is fit for any purpose.
* Visit http://www.pragmaticprogrammer.com/titles/eband2 for more book information.
***/
package org.example.video;
import android.app.Activity;
import android.os.Bundle;
import android.widget.VideoView;
public class Video extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Fill view from resource
setContentView(R.layout.main);
VideoView video = (VideoView) findViewById(R.id.video);
// Load and start the movie
video.setVideoPath("/sdcard/family_guy.mp4");
video.start();
}
} |
Partager