Code example for SurfaceView

Methods: getHeightgetWidth

0
		} 
	} 
	 
	private void setSurfaceViewScale(){ 
		 
		int width = video.getWidth();
		int height = video.getHeight();
		float boxWidth = width;
		float boxHeight = height;
 
		float videoWidth = mMediaPlayer.getVideoWidth();
		float videoHeight = mMediaPlayer.getVideoHeight();
 
		float wr = boxWidth / videoWidth;
		float hr = boxHeight / videoHeight;
		float ar = videoWidth / videoHeight;
 
		if (wr > hr)
		    width = (int) (boxHeight * ar);
		else 
Connect your IDE to all the code out there  Get Codota for Java