end of the day commit. multiple concurrent instances seems to be at least somewhat under control, but other parts of extension still need modifications and testing.

This commit is contained in:
Tamius Han 2018-03-07 23:49:43 +01:00
parent ba841c6ea3
commit 93d3b064da
3 changed files with 10 additions and 10 deletions

View File

@ -75,7 +75,7 @@ var Settings = {
allowedMisaligned: 0.05, // top and bottom letterbox thickness can differ by this much.
// Any more and we don't adjust ar.
allowedArVariance: 0.075, // amount by which old ar can differ from the new (1 = 100%)
timer_playing: 100, // we trigger ar this often (in ms) under this conditions
timer_playing: 30, // we trigger ar this often (in ms) under this conditions
timer_paused: 3000,
timer_error: 3000,
timer_minimumTimeout: 5, // but regardless of above, we wait this many msec before retriggering

View File

@ -35,26 +35,26 @@ var _pd_isFullScreen = function(){
var _pd_getPlayerDimensions = function(element){
if(element == null){
if(element == null || element == undefined){
if(Debug.debug)
console.log("[PlayerDetect::_pd_getPlayerDimensions] element is not valid, doing nothing.", element)
return;
}
try{
var trustCandidateAfterGrows = 2; // if candidate_width or candidate_height increases in either dimensions this many
// times, we say we found our player. (This number ignores weird elements)
// in case our <video> is bigger than player in one dimension but smaller in the other
// if site is coded properly, player can't be wider than that
var candidate_width = Math.max(element.offsetWidth, window.width);
var candidate_height = Math.max(element.offsetHeight, window.height);
var candidate_width = Math.max(element.offsetWidth, window.innerWidth);
var candidate_height = Math.max(element.offsetHeight, window.innerHeight);
var playerCandidateNode = element;
// <video> can't be root in a document, so we can do this
element = element.parentNode;
try{
var grows = trustCandidateAfterGrows;
while(element != undefined){
// odstranimo čudne elemente, ti bi pokvarili zadeve

View File

@ -381,10 +381,10 @@ var _res_restore = function(){
else if(GlobalVars.lastAr.type == "auto"){
// do same as static, except keep lastAr to 'auto'. If we're here, this means video probably changed
// and there's something broken that prevents AR from working properly
// var storeLastAr = {type: GlobalVars.lastAr.type, ar: GlobalVars.lastAr.ar};
// _res_setAr(GlobalVars.lastAr.ar);
// GlobalVars.lastAr = storeLastAr;
ArDetect.init();
var storeLastAr = {type: GlobalVars.lastAr.type, ar: GlobalVars.lastAr.ar};
_res_setAr(GlobalVars.lastAr.ar);
GlobalVars.lastAr = storeLastAr;
// ArDetect.init();
}
}