think this should be good for release
This commit is contained in:
parent
9a5f586eaf
commit
cdd533e093
192
CHANGELOG.md
Normal file
192
CHANGELOG.md
Normal file
@ -0,0 +1,192 @@
|
||||
# Changelog
|
||||
|
||||
|
||||
### v2.2.4 (AMO)
|
||||
|
||||
Lots of mostly incredibly minor stuff.
|
||||
|
||||
* Fixed issue where 21:9 videos with no letterbox would be zoomed in incorrectly in theater mode
|
||||
* Added pillarbox basic pillarbox detection: extension will avoid zooming in a video if both letterbox and pillarbox are detected. This should fix the issues with incorrect zooming on certain kinds of images (such as movie titles and studio logos, e.g. [lucasfilm](https://i.ytimg.com/vi/H368H5cTqVM/maxresdefault.jpg) was one of the offenders).
|
||||
* Fixed an issue where automatic detection would sometimes _not_ unzoom the video in cases where it clearly should
|
||||
* Implemented some debugging tools for me. It's not much.
|
||||
* Fixed some under-the-hood bugs nobody knew they even existed
|
||||
* A lil bit of refactoring
|
||||
|
||||
### v2.2.3 (AMO)
|
||||
|
||||
* Fixed automatic aspect ratio detection on DRM-protected sites.
|
||||
|
||||
### v2.2.2
|
||||
|
||||
* Fixes problems with switching from normal to fullscreen player on youtube. If 2.2.1 didn't fix the font issue, this version should have.
|
||||
|
||||
### v2.2.1 (Chrome)
|
||||
|
||||
* Fixes few chrome-specific fixes/bugs that v2.2.0 introduced. Maybe fixed the font problem.
|
||||
|
||||
|
||||
### v2.2.0
|
||||
|
||||
Various improvements to automatic aspect ratio detection:
|
||||
|
||||
* **Fixed the situation with insane memory usage due to the automatic aspect ratio detection (#25, #32) and lag that appeared in certain cases after the extension has been running for a while.** There's still fun stuff going on — see notes below.
|
||||
* Improved accuracy of automatic detection. This should fix the issue of rapid switching in dark videos or videos with otherwise uneven edges (#12 - [video](https://www.youtube.com/watch?v=NaTGwlfRB_c); #24 - [video](https://www.youtube.com/watch?v=xvZqHgFz51I) (see the car at the beginning))
|
||||
|
||||
Improved accuracy has increased the base RAM usage, and not by a small amount (I seem to have fixed my blunders, so that could _actually_ be on Firefox). As a result, I've reduced both resolution of the sample as well as polling frequency.
|
||||
|
||||
Polling of 1 check per second shouldn't use too much RAM. If you want automatic aspect ratio detection to react faster, you can up that number to 30 in the settings. 30 checks per second can be expensive: up to 400 MB if you've just started Firefox and went to youtube. Can go north of 2 gigs if you've been running Firefox for longer than that (seems to be a problem with Javascript garbage collection).
|
||||
|
||||
Videos that aren't playing (e.g. videos that are paused or ended) do (should) ***not*** use any meaningful amount of RAM.
|
||||
|
||||
* Overpass font is now bundled with this extension, meaning the popup should appear the way it was meant to appear™.
|
||||
|
||||
|
||||
### v2.1.4
|
||||
|
||||
* Extension has been disabled on imgur (it was breaking gifs)
|
||||
|
||||
### v2.1.3
|
||||
|
||||
* Youtube pushed an update that broke this extension on Firefox (but not on Chrome?). This update fixes it.
|
||||
* Extension disabled on reddit by default
|
||||
|
||||
Youtube fix seems to have broken Chrome compatibility (again), so any quick fix for this point forward will land in Chrome version along with v2.2.
|
||||
|
||||
### v2.1.2
|
||||
|
||||
* Fixed some bugs with autodetection sometimes not working properly on Youtube.
|
||||
|
||||
Problem: there's this bit of code that keeps aspect ratio from changing when the difference between 'previous' and 'current' aspect ratio is too small. Unfortunately, the 'previous' value was _not_ updated on every aspect ratio switch for some reason. Also `ArDetect.init()` — for some reason — didn't always clean the 'previous' value even though it should.
|
||||
|
||||
### v2.1.1
|
||||
|
||||
* Fixed issue #20 — aspect ratio autodetection should now start on subsequent videos as well.
|
||||
* Netflix sometimes always showed 'no video detected' warning. Popup and background script now periodically poll for `hasVideos` property.
|
||||
|
||||
### v2.1.0 (Chrome)
|
||||
|
||||
* Popup should work more reliably now
|
||||
* Twitch works ... kinda but not always
|
||||
|
||||
### v2.0.3
|
||||
|
||||
* Fixed the bug where Netflix videos weren't vertically centered in Firefox 57+ (not present in Chrome or FF 56 or earlier)
|
||||
|
||||
### v2.0.2
|
||||
|
||||
v2.0.1, but UI in the extension button now also works in Chrome.
|
||||
|
||||
### v2.0.1
|
||||
|
||||
* Autodetection: aspect ratio is no longer corrected if the detected difference is too small to make a meaningful difference
|
||||
|
||||
### v2.0
|
||||
|
||||
* Completely rewritten
|
||||
* Automatic aspect ratio detection works on Youtube _and_ Netflix
|
||||
* Added popup for quick actions (serves as a replacement for player UI)
|
||||
* Restored settings page for keybinds.
|
||||
|
||||
Getting automatic aspect ratio detection required some hacks, not sure how easy will be to port to chrome.
|
||||
|
||||
### v2.0a1
|
||||
|
||||
The extension is being rewritten almost ground-up, around automatic aspect ratio detection. By default, this extension now only works in fullscreen, but due to some simplification it should work on most sites. As direct result of this simplification:
|
||||
|
||||
* The UI is completely gone
|
||||
* Ability to add custom sites has been scrapped (might get implemented later on if some sites are a bit more problematic
|
||||
* Extension broken up between smaller files, this time the proper way
|
||||
* Added "the impossible aspect ratio autodetection"
|
||||
* Zoom/unzoom options are gone
|
||||
* Can't customize keybinds yet
|
||||
|
||||
### v1.3a1
|
||||
|
||||
* 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.
|
||||
|
||||
### v1.2.1
|
||||
|
||||
* 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
|
||||
|
||||
* Auto-aspect ratio detection on netflix
|
||||
* initial port to Chrome
|
||||
|
||||
### v1.1.1
|
||||
|
||||
* 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)
|
||||
|
||||
### v1.1.0
|
||||
|
||||
* 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.
|
||||
|
||||
### 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).
|
||||
|
||||
### 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)
|
17
README-PERMISSIONS.md
Normal file
17
README-PERMISSIONS.md
Normal file
@ -0,0 +1,17 @@
|
||||
#Permissions
|
||||
|
||||
This extension requires some permissions. Here's why.
|
||||
|
||||
#TL;DR version:
|
||||
|
||||
* **All tabs** — allows this extension to work on any site (By default, you need to enable sites other than those supported by default manually). Automatic detection on Netflix also [requires this permission](https://discourse.mozilla.org/t/drawwindow-in-webextension/13811) (or at least it did as of January 2018).
|
||||
* **Access browser tabs** — required for the popup to work (and it still doesn't always).
|
||||
* **Access browser activity during navigation** — makes some stuff with displaying popup easier. Most notably, it's used to ask the tab you're switching to whether it contains any videos, so this information is known before you need to open the popup.
|
||||
|
||||
#Technical mumbo-jumbo
|
||||
|
||||
todo
|
||||
|
||||
#This extension asks for permission that isn't listed above.
|
||||
|
||||
Sometimes (and by 'sometimes' I mean 'way too often') I forget to update README files. If there's a permission that I haven't wrote an explanation for, please [open an issue](https://github.com/xternal7/ultrawidify/issues).
|
184
README.md
184
README.md
@ -6,13 +6,13 @@ If you own an ultrawide monitor, you have probably noticed that sometimes videos
|
||||
|
||||
![Demo](img-demo/example-httyd2.png "Should these black bars be here? No [...] But an ultrawide user never forgets.")
|
||||
|
||||
Works (tested!) on Youtube and Netflix, but you can try your luck with other sites as well. Available for [Firefox (v2.0.3)](https://addons.mozilla.org/en/firefox/addon/ultrawidify/) and [Chrome (v2.0.2)](https://chrome.google.com/webstore/detail/ultrawidify/dndehlekllfkaijdlokmmicgnlanfjbi). Should support theater mode on youtube, iframes only supported on fullscreen.
|
||||
Works (tested!) on Youtube and Netflix, but you can try your luck with other sites as well. Available for [Firefox](https://addons.mozilla.org/en/firefox/addon/ultrawidify/) and [Chrome](https://chrome.google.com/webstore/detail/ultrawidify/dndehlekllfkaijdlokmmicgnlanfjbi). Should support theater mode on youtube, iframes only supported on fullscreen.
|
||||
|
||||
Youtube demo of autodetection stuff can be found [here](https://www.youtube.com/watch?v=j2xn1WpbtCQ).
|
||||
|
||||
## Beggathon
|
||||
|
||||
Working on this extension takes time, coffee and motivation. If you want to buy me a beer or something, you can [use this link to send me motivation](https://www.paypal.me/tamius). Money will be spent on Netflix and coffee/tea.
|
||||
Working on this extension takes time, coffee and motivation. If you want to buy me a beer or something, you can [use this link to send me motivation](https://www.paypal.me/tamius). **Any donations are well appreciated.**
|
||||
|
||||
## The long version
|
||||
|
||||
@ -72,6 +72,7 @@ Manually triggering aspect ratio change will suspend automatic aspect ratio dete
|
||||
## Known issues
|
||||
|
||||
* Netflix autodetection not working in Chrome, wontfix as issue is fundamentally unfixable. (Although a different kind of workaround could probably be put in place, but don't count on it)
|
||||
* Everything reported in [issues](https://github.com/xternal7/ultrawidify/issues)
|
||||
|
||||
## Plans for the future
|
||||
|
||||
@ -85,181 +86,6 @@ reintroduce settings page (rebindable keys, blacklist/whitelist management, some
|
||||
|
||||
## Changelog
|
||||
|
||||
### v2.2.3 (AMO)
|
||||
see changelog.md
|
||||
|
||||
* Fixed automatic aspect ratio detection on DRM-protected sites.
|
||||
|
||||
### v2.2.2
|
||||
|
||||
* Fixes problems with switching from normal to fullscreen player on youtube. If 2.2.1 didn't fix the font issue, this version should have.
|
||||
|
||||
### v2.2.1 (Chrome)
|
||||
|
||||
* Fixes few chrome-specific fixes/bugs that v2.2.0 introduced. Maybe fixed the font problem.
|
||||
|
||||
|
||||
### v2.2.0
|
||||
|
||||
Various improvements to automatic aspect ratio detection:
|
||||
|
||||
* **Fixed the situation with insane memory usage due to the automatic aspect ratio detection (#25, #32) and lag that appeared in certain cases after the extension has been running for a while.** There's still fun stuff going on — see notes below.
|
||||
* Improved accuracy of automatic detection. This should fix the issue of rapid switching in dark videos or videos with otherwise uneven edges (#12 - [video](https://www.youtube.com/watch?v=NaTGwlfRB_c); #24 - [video](https://www.youtube.com/watch?v=xvZqHgFz51I) (see the car at the beginning))
|
||||
|
||||
Improved accuracy has increased the base RAM usage, and not by a small amount (I seem to have fixed my blunders, so that could _actually_ be on Firefox). As a result, I've reduced both resolution of the sample as well as polling frequency.
|
||||
|
||||
Polling of 1 check per second shouldn't use too much RAM. If you want automatic aspect ratio detection to react faster, you can up that number to 30 in the settings. 30 checks per second can be expensive: up to 400 MB if you've just started Firefox and went to youtube. Can go north of 2 gigs if you've been running Firefox for longer than that (seems to be a problem with Javascript garbage collection).
|
||||
|
||||
Videos that aren't playing (e.g. videos that are paused or ended) do (should) ***not*** use any meaningful amount of RAM.
|
||||
|
||||
* Overpass font is now bundled with this extension, meaning the popup should appear the way it was meant to appear™.
|
||||
|
||||
|
||||
### v2.1.4
|
||||
|
||||
* Extension has been disabled on imgur (it was breaking gifs)
|
||||
|
||||
### v2.1.3
|
||||
|
||||
* Youtube pushed an update that broke this extension on Firefox (but not on Chrome?). This update fixes it.
|
||||
* Extension disabled on reddit by default
|
||||
|
||||
Youtube fix seems to have broken Chrome compatibility (again), so any quick fix for this point forward will land in Chrome version along with v2.2.
|
||||
|
||||
### v2.1.2
|
||||
|
||||
* Fixed some bugs with autodetection sometimes not working properly on Youtube.
|
||||
|
||||
Problem: there's this bit of code that keeps aspect ratio from changing when the difference between 'previous' and 'current' aspect ratio is too small. Unfortunately, the 'previous' value was _not_ updated on every aspect ratio switch for some reason. Also `ArDetect.init()` — for some reason — didn't always clean the 'previous' value even though it should.
|
||||
|
||||
### v2.1.1
|
||||
|
||||
* Fixed issue #20 — aspect ratio autodetection should now start on subsequent videos as well.
|
||||
* Netflix sometimes always showed 'no video detected' warning. Popup and background script now periodically poll for `hasVideos` property.
|
||||
|
||||
### v2.1.0 (Chrome)
|
||||
|
||||
* Popup should work more reliably now
|
||||
* Twitch works ... kinda but not always
|
||||
|
||||
### v2.0.3
|
||||
|
||||
* Fixed the bug where Netflix videos weren't vertically centered in Firefox 57+ (not present in Chrome or FF 56 or earlier)
|
||||
|
||||
### v2.0.2
|
||||
|
||||
v2.0.1, but UI in the extension button now also works in Chrome.
|
||||
|
||||
### v2.0.1
|
||||
|
||||
* Autodetection: aspect ratio is no longer corrected if the detected difference is too small to make a meaningful difference
|
||||
|
||||
### v2.0
|
||||
|
||||
* Completely rewritten
|
||||
* Automatic aspect ratio detection works on Youtube _and_ Netflix
|
||||
* Added popup for quick actions (serves as a replacement for player UI)
|
||||
* Restored settings page for keybinds.
|
||||
|
||||
Getting automatic aspect ratio detection required some hacks, not sure how easy will be to port to chrome.
|
||||
|
||||
### v2.0a1
|
||||
|
||||
The extension is being rewritten almost ground-up, around automatic aspect ratio detection. By default, this extension now only works in fullscreen, but due to some simplification it should work on most sites. As direct result of this simplification:
|
||||
|
||||
* The UI is completely gone
|
||||
* Ability to add custom sites has been scrapped (might get implemented later on if some sites are a bit more problematic
|
||||
* Extension broken up between smaller files, this time the proper way
|
||||
* Added "the impossible aspect ratio autodetection"
|
||||
* Zoom/unzoom options are gone
|
||||
* Can't customize keybinds yet
|
||||
|
||||
### v1.3a1
|
||||
|
||||
* 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.
|
||||
|
||||
### v1.2.1
|
||||
|
||||
* 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
|
||||
|
||||
* Auto-aspect ratio detection on netflix
|
||||
* initial port to Chrome
|
||||
|
||||
### v1.1.1
|
||||
|
||||
* 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)
|
||||
|
||||
### v1.1.0
|
||||
|
||||
* 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.
|
||||
|
||||
### 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).
|
||||
|
||||
### 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)
|
||||
todo: add link to changelog.md here
|
@ -1,6 +1,6 @@
|
||||
// Set prod to true when releasing
|
||||
// _prod = true;
|
||||
_prod = false;
|
||||
_prod = true;
|
||||
// _prod = false;
|
||||
|
||||
Debug = {
|
||||
debug: true,
|
||||
@ -24,8 +24,17 @@ Debug = {
|
||||
}
|
||||
|
||||
if(_prod){
|
||||
for(var key in Debug){
|
||||
Debug[key] = false;
|
||||
__disableAllDebug(Debug);
|
||||
}
|
||||
|
||||
function __disableAllDebug(obj) {
|
||||
for(key in obj) {
|
||||
if (obj.hasOwnProperty(key) ){
|
||||
if(obj[key] instanceof Object)
|
||||
__disableAllDebug(obj[key]);
|
||||
else
|
||||
obj[key] = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -500,8 +500,6 @@ var _ard_vdraw_but_for_reals = function() {
|
||||
}
|
||||
}
|
||||
|
||||
console.log("GUARDLINE RESULT:", guardLineResult, guardLineOut)
|
||||
|
||||
imageDetectOut = _ard_guardLineImageDetect(image, fallbackMode);
|
||||
imageDetectResult = imageDetectOut.success;
|
||||
|
||||
@ -748,7 +746,7 @@ var textLineTest = function(image, row){
|
||||
|
||||
// pregledamo rezultate:
|
||||
// analyse the results
|
||||
console.log("pulse test:\n\npulses:", pulseCount, "longest black:", longestBlack);
|
||||
// console.log("pulse test:\n\npulses:", pulseCount, "longest black:", longestBlack);
|
||||
|
||||
// če smo zaznali dovolj pulzov, potem vrnemo res
|
||||
// if we detected enough pulses, we return true
|
||||
|
@ -118,11 +118,26 @@ var _res_setAr = function(ar){
|
||||
if(Debug.debug)
|
||||
console.log("[Resizer::_res_setAr] video:",vid,"width:", vid.videoWidth, "height:", vid.videoHeight);
|
||||
|
||||
// // Dejansko razmerje stranic datoteke/<video> značke
|
||||
if(! GlobalVars.playerDimensions || GlobalVars.playerDimensions.width === 0 || GlobalVars.playerDimensions.height){
|
||||
GlobalVars.playerDimensions = PlayerDetect.getPlayerDimensions(vid);
|
||||
|
||||
if(Debug.debug)
|
||||
console.log("[Resizer::_res_setAr] playerDimensions are undefined, trying to determine new ones ... new dimensions:", GlobalVars.playerDimensions.width, "×", GlobalVars.playerDimensions.height, "| obj:", GlobalVars.playerDimensions);
|
||||
|
||||
if(! GlobalVars.playerDimensions || GlobalVars.playerDimensions.width === 0 || GlobalVars.playerDimensions.height === 0){
|
||||
if(Debug.debug)
|
||||
console.log("[Resizer::_res_setAr] failed to get player dimensions. Doing nothing. Here's the object:", GlobalVars.playerDimensions);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Dejansko razmerje stranic datoteke/<video> značke
|
||||
// Actual aspect ratio of the file/<video> tag
|
||||
var fileAr = vid.videoWidth / vid.videoHeight;
|
||||
|
||||
if(ar == "default")
|
||||
var playerAr = GlobalVars.playerDimensions.width / GlobalVars.playerDimensions.height;
|
||||
|
||||
if(ar == "default" || !ar)
|
||||
ar = fileAr;
|
||||
|
||||
|
||||
@ -134,27 +149,20 @@ var _res_setAr = function(ar){
|
||||
height: 0
|
||||
}
|
||||
|
||||
|
||||
if(GlobalVars.playerDimensions === undefined){
|
||||
GlobalVars.playerDimensions = PlayerDetect.getPlayerDimensions(vid);
|
||||
|
||||
if(Debug.debug)
|
||||
console.log("[Resizer::_res_setAr] playerDimensions are undefined, trying to determine new ones ... new dimensions:", GlobalVars.playerDimensions.width, "×", GlobalVars.playerDimensions.height, "| obj:", GlobalVars.playerDimensions);
|
||||
}
|
||||
|
||||
if(Debug.debug){
|
||||
console.log("[Resizer::_res_setAr] Player dimensions?", GlobalVars.playerDimensions.width, "×", GlobalVars.playerDimensions.height, "| obj:", GlobalVars.playerDimensions);
|
||||
}
|
||||
|
||||
if( fileAr < ar ){
|
||||
// imamo letterbox zgoraj in spodaj -> spremenimo velikost videa (ampak nikoli na več, kot je širina zaslona)
|
||||
// imamo letterbox zgoraj in spodaj -> spremenimo velikost videa (a nikoli širše od ekrana)
|
||||
// letterbox -> change video size (but never to wider than monitor width)
|
||||
videoDimensions.width = Math.min(GlobalVars.playerDimensions.height * ar, GlobalVars.playerDimensions.width);
|
||||
videoDimensions.height = videoDimensions.width * (1/fileAr);
|
||||
|
||||
videoDimensions.width = Math.min(GlobalVars.playerDimensions.height * ar, GlobalVars.playerDimensions.width);
|
||||
videoDimensions.height = videoDimensions.width * (1/fileAr);
|
||||
}
|
||||
else{
|
||||
videoDimensions.height = Math.min(GlobalVars.playerDimensions.width * (1/ar), GlobalVars.playerDimensions.height);
|
||||
videoDimensions.width = videoDimensions.height * fileAr;
|
||||
videoDimensions.height = Math.min(GlobalVars.playerDimensions.width * (1/ar), GlobalVars.playerDimensions.height);
|
||||
videoDimensions.width = videoDimensions.height * fileAr;
|
||||
}
|
||||
|
||||
if(Debug.debug){
|
||||
@ -171,10 +179,10 @@ var _res_setAr = function(ar){
|
||||
}
|
||||
|
||||
var _res_computeOffsets = function(vidDim, playerDim){
|
||||
|
||||
|
||||
if(Debug.debug)
|
||||
console.log("[Resizer::_res_computeOffsets] video will be aligned to ", ExtensionConf.miscFullscreenSettings.videoFloat);
|
||||
|
||||
|
||||
var offsets = {
|
||||
width: vidDim.width,
|
||||
height: vidDim.height,
|
||||
@ -392,9 +400,9 @@ var _res_antiCssOverride = function(){
|
||||
}
|
||||
|
||||
if(stuffChecked == stuffToCheck){
|
||||
// if(Debug.debug){
|
||||
// console.log("[Resizer::_res_antiCssOverride] My spaghett rests untouched. (nobody overrode our CSS, doing nothing)");
|
||||
// }
|
||||
// if(Debug.debug){
|
||||
// console.log("[Resizer::_res_antiCssOverride] My spaghett rests untouched. (nobody overrode our CSS, doing nothing)");
|
||||
// }
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"manifest_version": 2,
|
||||
"name": "Ultrawidify",
|
||||
"version": "2.2.4a",
|
||||
"version": "2.2.4",
|
||||
|
||||
"icons": {
|
||||
"32":"res/icons/uw-32.png",
|
||||
|
Loading…
Reference in New Issue
Block a user