From e3a3564d6db15455697659da0ae2ea4d179d48ab Mon Sep 17 00:00:00 2001 From: Stephen Cameron Date: Fri, 25 Aug 2017 19:12:21 +0200 Subject: [PATCH] Prevent video popups being scaled beyond the native resolution of the video. WIP #1585 @1 --- js/libs/fluidbook/fluidbook.menu.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; -- 2.39.5