Jump to content

- - - - -

Player size 16*9

  • Please log in to reply
No replies to this topic

#1 dargre


    Senior Member

  • Members
  • PipPipPipPipPip
  • 991 posts

Posted 18 February 2017 - 12:23 AM

As many know AVS player size is calculated to 100% width of parent container and height relatively to video aspect ratio.

This looks good when video is 16*9 aspect ratio.

Things get worse when video is 4:3 aspect ratio, and even worse when one decide for a player of page full width or when video is 4:3 on mobile devices. Player size looks unnatural, too high, much different than on other websites.


If you check youtube or vimeo and most of other websites, player size is same for every video, 16*9 aspect ratio. When video is 4:3 aspect ratio it simply shows black bars on left and right.


If someone prefer to keep player always 16*9 aspect ratio, just like youtube or vimeo the fix is pretty easy.

Edit template file "video.tpl"



height =  Math.round(width / (video_width / video_height));

Replace to:

height =  Math.round((width*9)/16);


vheight =  Math.round(vwidth / (video_width / video_height));

Replace to:

vheight =  Math.round((vwidth*9)/16);

Easy. Concerns AVS versions 3.x and 4

Posting this as I was requested for such fix  by few AVS users already and I do not have time to reply each request by email.

Edited by dargre, 18 February 2017 - 01:36 AM.

VIDEO.JS - best HTML5 player in the world for AVS script

NUEVOPLAYER 8 - best flash+html5 player for video scripts
Mods, custom code by NuevoLab (Search Suggest, Multiple image upload, Seo mods,and much more)