ultrawidify/README.md

192 lines
9.5 KiB
Markdown
Raw Permalink Normal View History

2017-09-15 19:44:20 +02:00
This is the v1 of the project. This branch is the original source for the extension, which is now obsolete (due to the code rewrite started in october 2017). See main (stable) and v2 (current) branches for something that's still getting maintained.
2017-01-22 17:06:41 +01:00
# Ultrawidify — aspect ratio fixer for youtube and netflix
2016-10-16 16:44:55 +02:00
2017-01-22 17:06:41 +01:00
## TL;DR
2016-10-16 16:44:55 +02:00
2017-01-22 17:06:41 +01:00
If you own an ultrawide monitor, you have probably noticed that sometimes videos aren't encoded properly — they feature black bars on all four sides. This could happen because someone was incompetent (note: as far as youtube is concerned, improperly rendered videos might be due to youtube's implementation of certain new features). The extension kinda fixes that by doing this:
2016-10-16 16:44:55 +02:00
2016-10-22 21:45:16 +02:00
![Demo](img-demo/example-httyd2.png "Should these black bars be here? No [...] But an ultrawide user never forgets.")
2016-10-16 16:44:55 +02:00
2017-04-27 20:06:57 +02:00
Works on Youtube and Netflix. Available for [Firefox (v1.2.1)](https://addons.mozilla.org/en/firefox/addon/ultrawidify/) and [Chrome (v1.2.1)](https://chrome.google.com/webstore/detail/ultrawidify/dndehlekllfkaijdlokmmicgnlanfjbi).
2016-10-16 16:44:55 +02:00
2017-01-22 17:06:41 +01:00
## The long version
2016-10-16 16:44:55 +02:00
2017-01-22 17:06:41 +01:00
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](https://support.google.com/youtube/answer/6375112)). Plenty of people surprisingly includes major Holywood studios, such as [Marvel](https://www.youtube.com/watch?v=Ke1Y3P9D0Bc), [Disney](https://www.youtube.com/watch?v=yCOPJi0Urq4), [Dreamworks](https://www.youtube.com/watch?v=oKiYuIsPxYk), [Warner Brothers](https://www.youtube.com/watch?v=VYZ3U1inHA4), [Sony](https://www.youtube.com/watch?v=7BWWWQzTpNU), et cetera. You'd think that this is the one thing Holywood studios and people who make [music videos for a living](https://www.youtube.com/watch?v=c6Mx2mxpaCY) would know how to do right, but they don't. This extension is here to fix that.
2016-10-16 16:44:55 +02:00
2017-01-22 17:06:41 +01:00
![Jesus Christ.](img-demo/example-jasonbourne.png "This is indeed worse than Snowden.")
2017-01-22 17:06:41 +01:00
## Features
2017-01-22 17:06:41 +01:00
* **Adds UI to the player's controls**
* **Fit video to width/height**
* **Zoom/unzoom video**
* **Force specific aspect ratio**
* **(Attempt to) autodetect aspect ratio** (Netflix only)
* **Rebindable shortcuts**
2017-01-22 17:06:41 +01:00
### User interface
2017-01-22 17:06:41 +01:00
![UI](img-demo/example-ui-general.png "If I ever found out that the video I'm in is 21:9, but encoded as 16:9 + black bars, I'd probably consider killing myself as well. To be completely fair, Blender institute did good job encoding the video properly. But of course there's some repost channels to fuck it up.")
2017-01-22 17:06:41 +01:00
To be entirely fair to the blender foundation, the video featured above is properly encoded. (However, few accounts that reposted it didn't sport the same levels of competence).
2016-10-16 16:44:55 +02:00
2017-01-22 17:06:41 +01:00
The 'more settings' menu contains all the buttons on the control bar, plus an option to force a specific aspect ratio — in case you're trying to watch a 16:9 video, that's encoded as 4:3 video, on a 21:9 monitor.
2017-01-22 17:06:41 +01:00
![UI](img-demo/example-ui-more-settings.png "If you know me and came looking for the obligatory »it's a wyvern, not a dragon« comment ... well, you just found it.")
2017-01-22 17:06:41 +01:00
These options might show some benefit for people not using 21:9 monitors, as they would allow you to crop a (proper) 21:9 to 16:9 (remove black bars at the cost of some video). 'Fit to height' would often do the same job, though.
2016-10-16 16:44:55 +02:00
2017-01-22 17:06:41 +01:00
### Default keyboard shortcuts
2016-10-16 16:44:55 +02:00
2017-01-22 17:06:41 +01:00
w - fit to width
e - fit to height
r - reset
z - zoom
u - unzoom
a - attempt to automatically determine the aspect ratio (netflix only)
s - force 21:9
d - force 16:9
x - force 16:10
c - force 4:3
2017-01-22 17:06:41 +01:00
### About Netflix aspect ratio autodetection
2017-01-22 17:06:41 +01:00
Automatic aspect ratio detection on Netflix works by grabbing the title of the video off Netflix' control bar and throws it at some third party services. First, it takes the title and throws it at OMDB. OMDB replies with IMDB id. We then throw that id at IMDB, which replies with 1700+ lines (and aspect ratio information is hopefully somewhere among them). If OMDB doesn't find the movie — or if the IMDB doesn't have information about aspect ratio for that particular title — automatic detection fails. There's also a posibility that this method returns the wrong data, as there's a possibility that multiple movies share the same title.
2017-01-22 17:06:41 +01:00
For best results with autodetection, please make sure the following requirements are met:
2017-01-22 17:06:41 +01:00
* Netflix, not youtube
* Netflix must be in English
* Movie title must be in English/the original title
* Movie must be known by OMDB
* Movie must have aspect ratio info on IMDB
2017-01-22 17:06:41 +01:00
## Installing
### Permanent install / stable
[v1.2.1 — Regular version — download from AMO](https://addons.mozilla.org/en/firefox/addon/ultrawidify/)
[v1.2.1 — Regular version — download from Chrome store](https://chrome.google.com/webstore/detail/ultrawidify/dndehlekllfkaijdlokmmicgnlanfjbi)
### Installing the current, github version
2017-01-22 17:06:41 +01:00
1. Clone this repo
2. Open up Firefox
3. Go to `about:debugging`
4. Add temporary addon
5. Browse to wherever you saved it and select manifest.json
## Known issues (in stable versions)
2016-10-16 16:44:55 +02:00
2017-01-22 17:06:41 +01:00
'More settings' button actually doesn't work at the moment.
2016-10-16 16:44:55 +02:00
## Plans for the future
* ~~Adding custom keybinds~~ (done at lastest)
* ~~Adding a proper settings page~~ (done at last)
* ~~Adding buttons for actions in youtube's player~~ (kinda done)
* ~~Adding an option to force specific aspect ratio~~ (now it's "good enough")
2017-01-22 01:15:03 +01:00
* ~~Port to Chrome~~
2017-01-22 17:06:41 +01:00
* ~~Have extension remember the last setting when switching between fullscreen and not fullscreen.~~ (kinda done)
* Have an option to remember last selected aspect ratio.
* Option to hide UI
2017-01-19 22:37:02 +01:00
* ~~Netflix support~~ (done)
## Changelog
###v1.3a1 (git/current version)
* Adding ability to add custom sites (in progress)
* Most of the extension is being completely rewritten to accomodate that feature, which means there's a serious regression with Netflix support (no netflix at the moment)
* I'm also trying to break the 1500 line behemoth into smaller files.
2017-01-23 18:46:11 +01:00
###v1.2.1 (AMO + Chrome)
2017-01-22 01:15:03 +01:00
* Fixed the bugs which caused aspect ratio to not be calculated properly.
* Introduced further changes that allow me to not keep two separate version for Firefox and Chrome.
###v1.2.0
2017-01-19 22:37:02 +01:00
* Auto-aspect ratio detection on netflix
2017-01-22 01:15:03 +01:00
* initial port to Chrome
2017-01-23 18:46:11 +01:00
###v1.1.1
2017-01-16 00:13:11 +01:00
* Fixed zooming issue on netflix
* Ultrawidify shortcuts > youtube/netflix shortcuts
* Fixed 'settings' page
* Fixed 'settings' (wrench button) popup on youtube (it was broken by one of the previous updates)
2017-01-19 22:37:02 +01:00
###v1.1.0
2017-01-09 18:48:43 +01:00
* Introduced Netflix support.
As Netflix relies on extension re-initializing at least the UI ***a lot***, the optimization introduced in 1.0.2 was reversed (as waiting 2 seconds for the UI to appear is just too much).
Furthermore, triggering UI re-initialisation on onUpdated events turned out to not be the proper way to go: immediately after the extension is initialized, onUpdated gets triggered even more often than your average Buzzfeed writer/reader. But change the episode on Netflix and suddenly, onUpdated gets barely triggered at all — which means that more often than not, the UI extension injects into the page wasn't visible. (the fuck, really)
This is why Netflix uses another function that manually checks whether the player bar is present. Ideally that check happens every tenth of a second, but Firefox may be limiting that to one per second.
2017-01-16 00:13:11 +01:00
###v1.0.2
The 'extension sometimes not working' bug was fixed (by having extension try to setup every time a page got updated), but the fix had some problems. Namely, the extension would re-initiate (complete with re-adding the entire UI) itself very _very_ often.
This could be a problem, so it was fixed. Extension is notified of updates only every ~2 seconds (which absorbs most of the "page was updated" events on page load) and doesn't attempt to reload the UI if the UI was already loaded. (Unless `debugmsg` is set to true. It's generally not, but any commits to this repo could potentially still have it enabled).
###v1.0.1
Fixed the bug where sometimes the extension would fail to work. (example: you opened youtube's search page in a brand new tab. You then opened a video from the search results (_not_ in a new tab). Extension wouldn't work at all in videos opened in that manner).
2017-01-09 18:48:43 +01:00
###v1.0.0
* Is pretty much rc1, except slightly different background image.
###v1.0-rc1
* Settings page is added and mostly working.
###v0.9.9.6
* The issue with buttons not fitting in the control bar was resolved.
###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.
###v0.9.9.1
* Keybinds `a` and `w` now work.
* Some changes under the bonnet, mostly regarding the way keypresses are handled.
* 'Settings' page is ~15% done.
###v0.9.9
* 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.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.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.6
* Added experimental feature that tries to force an aspect ratio
###v0.9.1
* First version on GitHub (and on AMO) with basic features (zoom, fit to width, fit to height)