Android: Mediaplayer: How to use SurfaceView or mediaplayer to play video in correct size

前端 未结 3 934
一向
一向 2020-12-04 10:24

I am playing local video file using MediaPlayer and SurfaceView. SurfaceView is the only control in activity, while my video files are QVGA or other. Problem is that video i

3条回答
  •  暖寄归人
    2020-12-04 11:05

    On your SurfaceView in XML are you using wrap_content ? This should fix your problem if not. You may need to paste a little more code for further investigation if that doesn't fix your problem.

    Change your surface view width to wrap_content as well.

提交回复
热议问题