/**
* 简单播放
*
* @time 下午05:15:41
* @author retacn yue
* @Email zhenhuayue@sina.com
*/
public class VideoViewDemoActivity extends Activity implements OnClickListener, MediaPlayerControl {
private VideoView videoView;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.video_view);
findView();
}
/**
* 实例化控件
*/
private void findView() {
videoView = (VideoView) this.findViewById(R.id.vdv_show);
Uri uri = Uri.parse(Environment.getExternalStorageDirectory().getPath() + "/kiss.mp4");
videoView.setVideoURI(uri);
videoView.setMediaController(new MediaController(this));
videoView.start();
}
@Override
public void onClick(View v) {
}
@Override
public void start() {
}
@Override
public void pause() {
}
@Override
public int getDuration() {
return 0;
}
@Override
public int getCurrentPosition() {
return 0;
}
@Override
public void seekTo(int pos) {
}
@Override
public boolean isPlaying() {
return false;
}
@Override
public int getBufferPercentage() {
return 0;
}
@Override
public boolean canPause() {
return false;
}
@Override
public boolean canSeekBackward() {
return false;
}
@Override
public boolean canSeekForward() {
return false;
}
}
* 简单播放
*
* @time 下午05:15:41
* @author retacn yue
* @Email zhenhuayue@sina.com
*/
public class VideoViewDemoActivity extends Activity implements OnClickListener, MediaPlayerControl {
private VideoView videoView;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.video_view);
findView();
}
/**
* 实例化控件
*/
private void findView() {
videoView = (VideoView) this.findViewById(R.id.vdv_show);
Uri uri = Uri.parse(Environment.getExternalStorageDirectory().getPath() + "/kiss.mp4");
videoView.setVideoURI(uri);
videoView.setMediaController(new MediaController(this));
videoView.start();
}
@Override
public void onClick(View v) {
}
@Override
public void start() {
}
@Override
public void pause() {
}
@Override
public int getDuration() {
return 0;
}
@Override
public int getCurrentPosition() {
return 0;
}
@Override
public void seekTo(int pos) {
}
@Override
public boolean isPlaying() {
return false;
}
@Override
public int getBufferPercentage() {
return 0;
}
@Override
public boolean canPause() {
return false;
}
@Override
public boolean canSeekBackward() {
return false;
}
@Override
public boolean canSeekForward() {
return false;
}
}