]> _ Git - fluidbook-html5.git/commitdiff
Prevent video popups being scaled beyond the native resolution of the video. WIP...
authorStephen Cameron <stephen@cubedesigners.com>
Fri, 25 Aug 2017 17:12:21 +0000 (19:12 +0200)
committerStephen Cameron <stephen@cubedesigners.com>
Fri, 25 Aug 2017 17:12:21 +0000 (19:12 +0200)
js/libs/fluidbook/fluidbook.menu.js

index 26835faf51b8e6a923194e9aa0353fc03f0de04a..7160cc52c3122b2e68ae489e7741f4c7e7e732bc 100644 (file)
@@ -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;