1. Crop and stretch options - tamius-han/ultrawidify GitHub Wiki

When trying to fit videos on your screen, there are roughly three options.

  • Crop
    The correct option is to crop only the letterbox encoded in the video. That's what 'crop' options do β€” they're designed to only removes double-letterboxing and ensure entire video is displayed at the biggest possible size without cropping any of it. After cropping, some empty space around video may remain, but only on two sides instead of four.

This is where functionality of this addon would stop if it were up to the creator of the addon. However, there's lots of people who will whine incessantly when a browser addon does exactly what it says it does, and not what they want it to do.

  • Zoom
    'Zoom' is very similar to crop, except that zoom allows you to "crop" more than just the encoded letterbox. This option will eliminate the empty space, cropping the video parts of the video if necessary. This option does not stretch the video.

  • Stretch
    This option stretches the image unevenly, and stacks with the crop options. Uncivilized people can use this option to stretch the video to fill the entire screen. Civilized people can use this option to revert stretched videos back to their native aspect ratio.

Here's quick visual illustration:

Crop

Crop modes adjust aspect ratio without cutting into video content.

Cropping mode supports the following options:

  • Automatic: try to determine aspect ratio automatically. Will not work if automatic aspect ratio detection is disabled for the site you're currently on:
  • 16:9: crop the video for 16:9 aspect ratio ([1:]1.77)
  • 21:9: crop the video for 21:9 aspect ratio ([1:]2.39)
  • 18:9: crop the video for 18:9 aspect ratio ([1:]2.00)
  • Reset: Resets the aspect ratio back to what it was by default.

NOTE: setting aspect ratio manually will cancel automatic aspect ratio detection. You may add custom aspect ratios in the settings.

Keyboard shortcuts

  • R β€” reset aspect ratio
  • A β€” detect aspect ratio automatically
  • S β€” crop for 16:9
  • X β€” crop for 18:9
  • D β€” crop for 21:9

Additional aspect ratios can be added or removed via extensions preferences page. It's also possible to change keyboard shortcuts there.

Zoom

Zoom uses a lot of the same options as cropping, except that it will happily crop parts of the video in order to minimize the empty space around it.

In addition to automatic modes and zooming for specific aspect ratios, zoom options also include:

  • Cover β€” fills the video player completely (black bars that are part of the video may remain visible in certain circumstances)
  • Zoom +5% β€” zooms in by 5%
  • Zoom -5% β€” zooms out by 5%

You may also zoom using the zoom slider. Slider scale is logarithmic. It is possible to scale width and height independently, but they are locked by default.

Keyboard shortcuts

  • Z β€” zoom
  • U β€” unzoom

Stretch

Stretch options allow you to eliminate letterboxing and pillarboxing by stretching the video to fill empty space, or to restore stretched videos to specific aspect ratio. Stretch options are generally independent of cropping, and are applied after cropping. This allows you to remove letterboxing via the crop options, and stretch the image to fill the remaining space.

Available stretch options:

  • Normal β€” don't apply stretching.
  • Basic β€” stretch the video until it fits the screen. Cropping is ignored when using this mode, which means that any black bars hardcoded in the video will be still present. If we're being completely honest, this shouldn't even be an option, but it's present for feature completeness sake. May be removed in a later version of this addon.
  • Hybrid β€” crop first, then stretch only what’s left. For example: when watching a 18:9 video on a 21:9 monitor, cropping it for 21:9 will crop too much while cropping it for 18:9 will remove the horizontal bars, but still leave vertical black bars. When using this mode, the extension will remove vertical bars with cropping, and then stretch the video to remove black bars.
  • Thin borders β€” will apply stretching only of black borders are very thin enough. By default, this option activates stretching only when black borders take up less than 5% of image width or height after cropping. This value can be changed in extension options. In short, this option will only stretch the image when distortion from stretching would be minimal.
  • Default (in Site Settings only) β€” when setting default stretching mode for a site, this option tells the site to use the extension-default stretching mode for the site.

By default there are no keyboard shortcuts associated with those actions. You can define keyboard settings on extension's "preferences" page.

Align videos

When playing a proper 16:9 video in fullscreen on a 21:9, the video will be centered with black bars on either side by default. Align options allow you to align video with an edge or corner of the video player.