How can I scale video in ExoPlayer-V2 – Play Video In Full Screen

Following two lines helped me to play video in full-screen mode. Using app:resize_mode in layout file this somehow help but it stretches the video as mentioned in the question picture. <com.google.android.exoplayer2.ui.PlayerView android:layout_width=”match_parent” app:resize_mode=”….” android:layout_height=”match_parent” /> Try changing AspectRatioFrameLayout to FILL,FIT,ZOOM… as per yout requirement, changing below line worked for me. exoVideoPlayerView.setResizeMode(AspectRatioFrameLayout.RESIZE_MODE_FILL); Bellow line will ensure … Read more

Maintain aspect ratio of div but fill screen width and height in CSS?

Use the new CSS viewport units vw and vh (viewport width / viewport height) FIDDLE Resize vertically and horizontally and you’ll see that the element will always fill the maximum viewport size without breaking the ratio and without scrollbars! (PURE) CSS div { width: 100vw; height: 56.25vw; /* height:width ratio = 9/16 = .5625 */ … Read more

How to auto-resize an image while maintaining aspect ratio

Do not apply an explicit width or height to the image tag. Instead, give it: max-width:100%; max-height:100%; Also, height: auto; if you want to specify a width only. Example: http://jsfiddle.net/xwrvxser/1/ img { max-width: 100%; max-height: 100%; } .portrait { height: 80px; width: 30px; } .landscape { height: 30px; width: 80px; } .square { height: 75px; … Read more

Strategies for Handling Multiple Screen Resolutions and Aspect Ratios in Web Development

I know this would be a somewhat controversial opinion, but I’d say it anyway: Don’t Don’t design for multiple screen sizes or aspect ratios. There are of course a few exceptions: Heavy web applications like webmail clients can definitely do with more screen real estate, and are probably flexible enough to accommodate a large range … Read more

Fixed aspect ratio View

I implemented FixedAspectRatioFrameLayout, so I can reuse it and have any hosted view be with fixed aspect ratio: public class FixedAspectRatioFrameLayout extends FrameLayout { private int mAspectRatioWidth; private int mAspectRatioHeight; public FixedAspectRatioFrameLayout(Context context) { super(context); } public FixedAspectRatioFrameLayout(Context context, AttributeSet attrs) { super(context, attrs); init(context, attrs); } public FixedAspectRatioFrameLayout(Context context, AttributeSet attrs, int defStyle) { … Read more

Maintaining aspect ratio with FFmpeg

-vf “scale=640:-1” works great until you will encounter error [libx264 @ 0x2f08120] height not divisible by 2 (640×853) So most generic approach is use filter expressions: scale=640:trunc(ow/a/2)*2 It takes output width (ow), divides it by aspect ratio (a), divides by 2, truncates digits after decimal point and multiplies by 2. It guarantees that resulting height … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)