pedroSG94 / vlc-example-streamplayer

Example code how to play a stream with VLC
GNU General Public License v3.0
229 stars 93 forks source link

Video size not adapting to fill view #29

Open Silvia4 opened 5 years ago

Silvia4 commented 5 years ago

Hi, I've a recycler view with multiple cameras. I've managed to get the various rtsp streams and display them. My problem is that the videos don't fill the SurfaceView, but are resized in the left-bottom corner of the view. How can I fill the view with the videos, maintaining their aspect ratio? Thanks

usamashahid049 commented 5 years ago

Facing the same issue. Share your solution if you solved. Thanks in advance.

arjanicki commented 5 years ago

Has anyone found a solution?

usamashahid049 commented 5 years ago

Yup, the issue is surface view height and width is zero. So i make another class and send height and width manually.

public VlcVideoLibrary(Context context, VlcListener vlcListener, SurfaceView surfaceView,int height,int width) { this.vlcListener = vlcListener; this.surfaceView = surfaceView; vlcInstance = new LibVLC(context, new VlcOptions().getDefaultOptions()); options.add(":fullscreen"); m_activity= (Activity) context; this.height=height; this.width=width; }