From: Stephen Cameron Date: Fri, 25 Aug 2017 17:12:21 +0000 (+0200) Subject: Prevent video popups being scaled beyond the native resolution of the video. WIP... X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=e3a3564d6db15455697659da0ae2ea4d179d48ab;p=fluidbook-html5.git Prevent video popups being scaled beyond the native resolution of the video. WIP #1585 @1 --- diff --git a/js/libs/fluidbook/fluidbook.menu.js b/js/libs/fluidbook/fluidbook.menu.js index 26835faf..7160cc52 100644 --- a/js/libs/fluidbook/fluidbook.menu.js +++ b/js/libs/fluidbook/fluidbook.menu.js @@ -506,6 +506,7 @@ FluidbookMenu.prototype = { } break; case 'video': + var maxVideoScale = 1; // Limits the scale. [eg. 1 = 1x (native size)] // Todo: consider making this an adjustable parameter? var video = m.find('.video-js'); nw = parseInt($(video).data('width')); @@ -521,7 +522,7 @@ FluidbookMenu.prototype = { fullscreen = true; } - var s = Math.min(w / nw, h / nh); + var s = Math.min(w / nw, h / nh, maxVideoScale); // Make sure scale doesn't go above maxVideoScale... if (!fullscreen) { w = nw * s;