¡@

Home 

2014/10/16 ¤W¤È 08:27:21

android Programming Glossary: videoproportion

Full screen videoview without stretching the video

http://stackoverflow.com/questions/12211837/full-screen-videoview-without-stretching-the-video

int videoHeight player.getVideoHeight float videoProportion float videoWidth float videoHeight int screenWidth getWindowManager.. lp surfaceViewFrame.getLayoutParams if videoProportion screenProportion lp.width screenWidth lp.height int float screenWidth.. lp.width screenWidth lp.height int float screenWidth videoProportion else lp.width int videoProportion float screenHeight lp.height..

Full screen videoview without stretching the video

http://stackoverflow.com/questions/12211837/full-screen-videoview-without-stretching-the-video

of the video so it fits on the screen int videoWidth player.getVideoWidth int videoHeight player.getVideoHeight float videoProportion float videoWidth float videoHeight int screenWidth getWindowManager .getDefaultDisplay .getWidth int screenHeight getWindowManager.. float screenWidth float screenHeight android.view.ViewGroup.LayoutParams lp surfaceViewFrame.getLayoutParams if videoProportion screenProportion lp.width screenWidth lp.height int float screenWidth videoProportion else lp.width int videoProportion.. if videoProportion screenProportion lp.width screenWidth lp.height int float screenWidth videoProportion else lp.width int videoProportion float screenHeight lp.height screenHeight surfaceViewFrame.setLayoutParams lp if player.isPlaying..