"Fit to width" and "fit to height" now calculate video fit according to player size, not screen size.
This commit is contained in:
parent
463dcc0692
commit
0c1cae3215
@ -182,7 +182,15 @@ var _res_reset = function(force){
|
|||||||
// handles "legacy" options, such as 'fit to widht', 'fit to height' and 'reset'. No zoom tho
|
// handles "legacy" options, such as 'fit to widht', 'fit to height' and 'reset'. No zoom tho
|
||||||
var _res_legacyAr = function(action){
|
var _res_legacyAr = function(action){
|
||||||
var vid = GlobalVars.video;
|
var vid = GlobalVars.video;
|
||||||
var ar = screen.width / screen.height;
|
var ar;
|
||||||
|
|
||||||
|
if(GlobalVars.playerDimensions === null || GlobalVars.playerDimensions === undefined){
|
||||||
|
ar = screen.width / screen.height;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
ar = GlobalVars.playerDimensions.width / GlobalVars.playerDimensions.height;
|
||||||
|
}
|
||||||
|
|
||||||
var fileAr = vid.videoWidth / vid.videoHeight;
|
var fileAr = vid.videoWidth / vid.videoHeight;
|
||||||
|
|
||||||
if(action == "fitw"){
|
if(action == "fitw"){
|
||||||
|
9
js/uw.js
9
js/uw.js
@ -101,12 +101,7 @@ function ghettoOnChange(){
|
|||||||
var video = document.getElementsByTagName("video")[0];
|
var video = document.getElementsByTagName("video")[0];
|
||||||
if(video !== undefined){
|
if(video !== undefined){
|
||||||
GlobalVars.video = video;
|
GlobalVars.video = video;
|
||||||
|
Comms.sendToBackgroundScript({"cmd":"register-video"});
|
||||||
// try{
|
|
||||||
Comms.sendToBackgroundScript({"cmd":"register-video"});
|
|
||||||
// }
|
|
||||||
// catch(chromeIsShitError){
|
|
||||||
// cos firefox won't crap its bed if a promise comes back unfulfilled
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -123,7 +118,7 @@ function ghettoOnChange(){
|
|||||||
if (newPlayerDims == undefined)
|
if (newPlayerDims == undefined)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
GlobalVars.playerDimeimensions = newPlayerDims;
|
GlobalVars.playerDimensions = newPlayerDims;
|
||||||
|
|
||||||
if ( newPlayerDims.width != _player_dimensions_last.width ||
|
if ( newPlayerDims.width != _player_dimensions_last.width ||
|
||||||
newPlayerDims.height != _player_dimensions_last.height){
|
newPlayerDims.height != _player_dimensions_last.height){
|
||||||
|
Loading…
Reference in New Issue
Block a user