1

My video view is in full screen landscape mode.
For setting the video view in full screen i have code in onMeasure which scales video view to fit the full screen but doing this my video aspect ration is getting destroyed and video is looking stretched.

So how can i maintain video aspect ratio while stretching video view.

Is there any way by which we can get the video aspect ration from video view or actual video height and width?

User7723337
  • 11,857
  • 27
  • 101
  • 182
  • 1
    I think you would have to get the resolution of the video and then do the math to scale it to the largest size possible yourself, then set your VideoView to that calculated value – FoamyGuy Oct 16 '13 at 14:40
  • But is there any inbuilt functionality in video view to maintain aspect ration? so that we can avoid doing it our self. – User7723337 Oct 18 '13 at 05:49
  • I don't think so...which is why I said I think you have to do the math yourself. You could certainly make a subclass of VideoView that was capable of it if you wished too. – FoamyGuy Oct 18 '13 at 13:15
  • so i have to write my one class which extends videoview and then sets the size of the video using "onMeasure" call. but how can i get video resolution? is it in videoview? – User7723337 Oct 18 '13 at 15:42

0 Answers0