video is now centered correctly

This commit is contained in:
Tamius Han 2018-05-16 20:42:00 +02:00
parent d38dee1a8a
commit 4914a0dc1c
2 changed files with 3 additions and 12 deletions

View File

@ -44,9 +44,6 @@ class PlayerData {
} }
startChangeDetection(){ startChangeDetection(){
console.log("STARTING CHANGE DETECTION!")
// // var gw = this.ghettoWatcher;
this.watchTimeout = setInterval(this.ghettoWatcher, 100, this); this.watchTimeout = setInterval(this.ghettoWatcher, 100, this);
} }
@ -55,8 +52,6 @@ class PlayerData {
} }
ghettoWatcher(ths){ ghettoWatcher(ths){
console.log("playerdata — dimensions", ths.dimensions)
try{
if(ths.checkPlayerSizeChange()){ if(ths.checkPlayerSizeChange()){
if(Debug.debug){ if(Debug.debug){
console.log("[uw::ghettoOnChange] change detected"); console.log("[uw::ghettoOnChange] change detected");
@ -90,10 +85,6 @@ class PlayerData {
ths.videoData.resizer.restore(); ths.videoData.resizer.restore();
} }
} }
catch(e){
console.log("e",e)
}
}
getPlayerDimensions(elementNames){ getPlayerDimensions(elementNames){
// element names — reserved for future use. If element names are provided, this function should return first element that // element names — reserved for future use. If element names are provided, this function should return first element that

View File

@ -171,15 +171,15 @@ class Resizer {
var defaultOffset = (this.conf.player.dimensions.height - videoDimensions.height) / 2; var defaultOffset = (this.conf.player.dimensions.height - videoDimensions.height) / 2;
offsets.top = defaultOffset + (defualtOffset * this.pan.relativeOffsetY); offsets.top = defaultOffset + (defualtOffset * this.pan.relativeOffsetY);
defaultOffset = (this.conf.player.dimensions.height - videoDimensions.width ) / 2; defaultOffset = (this.conf.player.dimensions.width - videoDimensions.width ) / 2;
offsets.left = defaultOffset + (defaultOffset * this.pan.relativeOffsetX); offsets.left = defaultOffset + (defaultOffset * this.pan.relativeOffsetX);
} else { } else {
if( ExtensionConf.miscFullscreenSettings.videoFloat == "center" ){ if( ExtensionConf.miscFullscreenSettings.videoFloat == "center" ){
offsets.left = (this.conf.player.dimensions.height - videoDimensions.width ) / 2; offsets.left = (this.conf.player.dimensions.width - videoDimensions.width ) / 2;
} }
else if( ExtensionConf.miscFullscreenSettings.videoFloat == "right" ){ else if( ExtensionConf.miscFullscreenSettings.videoFloat == "right" ){
offsets.left = (this.conf.player.dimensions.height - videoDimensions.width); offsets.left = (this.conf.player.dimensions.height - videoDimensions.height);
} }
} }