videoView

VideoView:activity界面中添加小型视频。、

视频的加载、播放

DisplayMetrics dm = new DisplayMetrics();

getWindowManager().getDefaultDisplay().getMetrics(dm);

int width = dm.widthPixels;

VideoView video = (VideoView) findViewById(R.id.video_view_show);

video.setVideoURI(Uri.parse("android.resource://”+ getPackageName() + "/" + R.raw.mp));

video.start();

video.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {

@Override

public void onCompletion(MediaPlayer mp) {

handsunshineView.startAnimation(zoomOutEnter);

handsunshineView.setVisibility(View.VISIBLE);}});

你可能感兴趣的:(android)