Code example for VideoView

Methods: isPlayingsetVideoURIstartstopPlayback, getParent, setId, setLayoutParams

0
		// inflator.inflate(R.layout.play_card_front_side_play_section_video, 
		// null); 
		// } 
		// videoView = (VideoView) 
		// activity.findViewById(R.id.playCardFrontSidePlaySectionVideoLayoutVideoViewId); 
		videoView = new VideoView(context);
		RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(
				RelativeLayout.LayoutParams.MATCH_PARENT,
				RelativeLayout.LayoutParams.MATCH_PARENT);
		videoView.setLayoutParams(layoutParams);
		videoView.setId(index * 15000);
 
		if (videoView.isPlaying()) {
			videoView.stopPlayback();
			RelativeLayout videoViewParentLayout = (RelativeLayout) videoView
					.getParent();
			videoViewParentLayout.removeAllViews();
			videoViewParentLayout
					.addView(playCardFrontSidePlaySectionImageWithPlayButtonLayout);
		} 
		// MediaController mc = new 
		// LiveClipsMediaController(videoView.getContext(), activity, 
		// videoView); 
 
		// mc.setMediaPlayer(videoView); 
		// videoView.setMediaController(mc); 
		RelativeLayout.LayoutParams playCardLayoutParameters = new RelativeLayout.LayoutParams(
				500, 400); 
 
		videoView.setLayoutParams(playCardLayoutParameters);
		// playCardFrontSidePlaySectionVideoLayout.addView(videoView); 
		// videoView.setVideoURI(Uri 
		// .parse("http://commonsware.com/misc/test2.3gp")); 
		videoView.setVideoURI(Uri
				.parse("http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4"));
 
		// playCardFrontSidePlaySectionVideoView.setVideoURI(Uri.parse("http://localhost:8080/nflvideo.3gp")); 
		videoView.start();
 
		// return playCardFrontSidePlaySectionVideoLayout; 
		return videoView;
	}