Greasy Fork

Zoom and crop YouTube videos to fill screen height

Removes letterboxing by cropping the left and right edges off of full-screen YouTube videos and zooming to fill the screen height.

当前为 2018-12-18 提交的版本,查看 最新版本

作者
uxamend
评分
0 0 0
版本
0.1
创建于
2018-12-18
更新于
2018-12-18
大小
2.6 KB
许可证
CC0-1.0
适用于

Background

It's now relatively common for YouTube videos to have aspect ratios wider than 16:9. By default, if these are played full-screen on a display with a narrower aspect ratio, they are letterboxed with horizontal black bars at the top and bottom. Depending on circumstances, video content and user preference, this might be annoying. It might be preferable to fill the screen height and crop off the sides of the video instead..

How it works

This script adds an event listener for the fullscreenchange event. When the video goes full-screen, and after a short delay to allow things to settle down, the script will adjust the dimensions of the video element so that it fills the screen height and is much wider than the screen, so that any excess video width falls outside the screen (i.e. gets cropped off). Video ads can cause the video to return to its default dimensions, so the script also watches for ad playback and re-resizes the video at the start and end of each ad.

Version history

0.1 First release. Probably full of bugs and stupid mistakes.