android 播放工程中的MP4

		final VideoView videoView = (VideoView) rootView.findViewById(R.id.videoView_healthcare);
			videoView.setMediaController(new MediaController(this));
			videoView.setVideoURI(Uri.parse("android.resource://com.cvte.health/" + R.raw.healthcare));
			WindowManager windowManager = this.getWindowManager();
			Display display = windowManager.getDefaultDisplay();


			LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT,
				LinearLayout.LayoutParams.FILL_PARENT);
			params.height = (int) (display.getHeight() * 0.8);
			params.width = (int) (display.getWidth() * 0.8);
			mDialog.setContentView(rootView, params);
			if (!mDialog.isShowing()) {
				mDialog.show();
				videoView.start();
			}

监听视频播放完的代码
videoView.setOnCompletionListener(new MediaPlayer.OnCompletionListener()
    {
     @Override
     public void onCompletion(MediaPlayer mp)
     {
           //播放结束后的动作
     }
    });

你可能感兴趣的:(android 播放工程中的MP4)