summaryrefslogtreecommitdiff
path: root/www/js/NVR.js
diff options
context:
space:
mode:
Diffstat (limited to 'www/js/NVR.js')
-rw-r--r--www/js/NVR.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/www/js/NVR.js b/www/js/NVR.js
index 99116eb4..93897623 100644
--- a/www/js/NVR.js
+++ b/www/js/NVR.js
@@ -326,6 +326,21 @@ angular.module('zmApp.controllers')
return p? loginData.unsupported[p]:loginData.unsupported;
}
+ function computeDeviceSize() {
+ var pixelRatio = window.devicePixelRatio || 1;
+ $rootScope.pixelRatio = pixelRatio;
+ $rootScope.devWidth = ((window.innerWidth > 0) ? window.innerWidth : screen.width);
+ $rootScope.devHeight = ((window.innerHeight > 0) ? window.innerHeight : screen.height);
+ $rootScope.videoHeight = $rootScope.devHeight - 20;
+ $rootScope.devWidthIgnorePix = $rootScope.devWidth;
+
+ $rootScope.devWidth *= pixelRatio;
+ $rootScope.devHeight *= pixelRatio;
+
+ debug("resize/orient: " + $rootScope.devWidth + "(w) * " + $rootScope.devHeight+"(h)");
+
+ }
+
function getBandwidth() {
// if mode is not on always return high
if (loginData.enableLowBandwidth == false) {
@@ -2867,6 +2882,9 @@ angular.module('zmApp.controllers')
getSnapshotFrame: function () {
return snapshotFrame;
},
+ computeDeviceSize: function () {
+ return computeDeviceSize();
+ },
//-----------------------------------------------------------------------------
// This function returns a list of monitors