diff --git a/js/plugins.js b/js/plugins.js index 7a09437..b81fa8b 100644 --- a/js/plugins.js +++ b/js/plugins.js @@ -117,8 +117,22 @@ // The width and height of the captured photo. We will set the // width to the value defined here, but the height will be // calculated based on the aspect ratio of the input stream. + var width = 0 + function myFunction(x) { + if (x.matches) { // If media query matches + width = 240; + } else { + width = 480; + } + } + + var x = window.matchMedia("(max-width: 500px)") + myFunction(x) // Call listener function at run time + x.addListener(myFunction) // Attach listener function on state changes + + - var width = 480; // We will scale the photo width to this + // We will scale the photo width to this var height = 0; // This will be computed based on the input stream // |streaming| indicates whether or not we're currently streaming