android - Issue when playing video in local and url path -


i play video in videoview

when play sd card, shows correct width , height in full screen. when try play server, video width smaller , video re-sized.

how can play video in original size , full screen?

take @ documentation , implement onprepared method following code:

//prepare video public void onprepared(mediaplayer mp) {             progressbarwait.setvisibility(view.gone);      //first size of video     int videowidth = player.getvideowidth();     int videoheight = player.getvideoheight();     float videoproportion = (float) videowidth / (float) videoheight;        //get size of screen     int screenwidth = getwindowmanager().getdefaultdisplay().getwidth();     int screenheight = getwindowmanager().getdefaultdisplay().getheight();     float screenproportion = (float) screenwidth / (float) screenheight;      //adjust     layoutparams lp = surfaceviewframe.getlayoutparams();     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()) {         player.start();              }     surfaceviewframe.setclickable(true); } 

Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -