5.9 KiB
Ultrawidify — youtube aspect ratio fixer for firefox
What does it do?
The technology has been here for a while, but plenty of people don't know how to properly encode a video (despite the fact youtube has an article that explains aspect ratios). Plenty of people surprisingly includes major Holywood studios, such as Marvel, Disney, Dreamworks, Warner Brothers, Sony, et cetera. You'd think that this is the one thing Holywood studios and people who make music videos for a living would know how to do right, but they don't. This extension is here to fix that.
TL;DR: it does this:
I'd demo with Sintel but they encoded the video without the black bars. Thanks, Blender Foundation. Actually they're not off the hook.
This extension also allows you to zoom in or out of video (similar to how SMPlayer does it).
Installing
Temporary install
- Clone this repo
- Open up Firefox
- Go to
about:debugging
- Add temporary addon
- Browse to wherever you saved it and select manifest.json
Permanent install
v0.9.9.5 — Experimental version — download from here — If 30 minutes old is stable enough for you, this is it. This version is pretty much code from this repo. It's also unlisted so I don't have to go through AMO for every minor change. It hasn't been tested whether autoupdating works, and it probably doesn't.
v0.9.9 — Regular version — download from AMO — more stable and with AMO's approval. No experimental features either. (NOTE: there's a version number hiccup going on with AMO version. Stuff here on Github is the freshest, regardless of what manifest says)
NOTE: Have only one version of the extension running at a time. Don't run both at the same time.
How do I use it?
This is the interface (NOTE: AMO version doesn't have buttons yet!):
And that's the keybinds for the actions displayed:
w
: fit to width (will crop top and bottom if video is taller than the display)e
: fit to height (will crop left and right if video is wider than the display)z
: zoomu
: unzoomr
: reset to default
As of version 0.9.6, there's also experimental feature that will try to force an aspect ratio for the video. You specify the aspect ratio of the video you're watching. Extension then looks at the actual aspect ratio of the video. If aspect ratios are different, extension assumes that video contains black borders and zooms in on the video, so the black bars are removed. For example: if the video you're watching is 4:3, but you specify it's actually 16:9, then the extension will zoom on 16:9 section inside that video.
As of 0.9.9, option to force aspect ratio is available from settings. That's this button:
If you can read this, you'll probably figure out the rest of the way.
¹These ratios are calculated using the number in the brackets, as 1920/1080 does not strictly equal to 16/9 (same goes for 21:9).
Please note that these keybindings could change at any time, and some definitely will (apparently some of them conflict with youtube player). I'll try to get them sorted out by the end of october.
What works
More or less everything. Works regardless of whether the video is in fullscreen or not. Works regardless if the youtube video you're watching is embedded on some other page.
What doesn't
On a very rare occasion, w
button won't work. So far this behaviour was seen in two videos out of countless I've tried. In cases like this, use z
to zoom instead.
Keybind a
just doesn't work at all, so no 16:10.
Plans for the future
- Adding custom keybinds
- Adding a proper settings page
Adding buttons for actions in youtube's player(kinda done)Adding an option to force specific aspect ratio(now it's "good enough")
Changelog
###v0.9.1
- First version on GitHub (and on AMO) with basic features (zoom, fit to width, fit to height)
###v0.9.6
- Added experimental feature that tries to force an aspect ratio
###v0.9.7
- No new features added. Version number got incremented due to an attempt at autoupdating (which got foiled due to lack of HTTPS)
###v0.9.8
- Added GUI/buttons on the player.
- Script now only loads on youtube pages (iframes included) (before, this script would run on any page)
###v0.9.9 <--- AMO version is here
- The aspect ratio thingy is now also in GUI
- Fixed code for forcing aspect ratio. At least I think it's fixed now.
###v0.9.9.1
- Keybinds
a
andw
now work. - Some changes under the bonnet, mostly regarding the way keypresses are handled.
- 'Settings' page is ~15% done.
###v0.9.9.5
- Played with settings and localstorage a bit, but no clear implementation yet.
- Fixed some bugs caused by event propagation.
- All buttons in the player's control bar are now also in the settings popup.
- Had to scrap settings page in its current form
- TODO: sometimes not all buttons can fit in the control bar. Such occurences should be detected.