Search code examples
androidscalesurfaceviewsurfaceholdervitamio

Scale vitamio with surfaceview


I am using Vitamio media player to play RTMP stream onto a SurfaceView, everything is fine but the video size is smaller than the screen. I am looking for a way to scale the video to fit the entire screen. I set the SurfaceHolder to the fixed size of my Nexus4 display (1280*720) and the video received is (950*640).

I tried overriding onDraw but no results. I am trying now to override unlockCanvasAndPost function of SurfaceHolder, so I can scale the canvas, but don't know exactly how to achieve this. Also, maybe there are related AVoptions I can pass to the player?


Solution

  • You can scale the video surface, VitamioDemo have a sample, https://github.com/yixia/VitamioBundle/blob/master/vitamio-sample/src/io/vov/vitamio/demo/VideoViewSubtitle.java