Skip to content

Commit 6d2a64b

Browse files
committed
Enlarged Camera window
1 parent d98c53f commit 6d2a64b

File tree

1 file changed

+16
-26
lines changed

1 file changed

+16
-26
lines changed

www/js/domoticz.js

Lines changed: 16 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1672,43 +1672,33 @@ function ShowCameraLiveStream(Name, camIdx) {
16721672
$('#dialog-camera-live #camfeed').attr("src", "images/camera_default.png");
16731673
//$('#dialog-camera-live #camfeed').attr("src", FeedURL);
16741674

1675-
var dwidth = $(window).width() / 2;
1676-
var dheight = $(window).height() / 2;
1677-
1678-
if (dwidth > 630) {
1679-
dwidth = 630;
1680-
dheight = parseInt((dwidth / 16) * 9);
1681-
}
1682-
if (dheight > 470) {
1683-
dheight = 470;
1684-
dwidth = parseInt((dheight / 9) * 16);
1685-
}
1686-
if (dwidth > dheight) {
1687-
dwidth = parseInt((dheight / 9) * 16);
1688-
}
1689-
else {
1690-
dheight = parseInt((dwidth / 16) * 9);
1691-
}
1675+
var windowWidth = $(window).width() - 20;
1676+
var windowHeight = $(window).height() - 150;
1677+
1678+
var AspectSource = 4 / 3;
1679+
1680+
var height = windowHeight;
1681+
var width = Math.round(height * AspectSource) & ~1;
1682+
if (width > windowWidth) {
1683+
width = windowWidth;
1684+
height = Math.round(width / AspectSource) & ~1;
1685+
}
1686+
16921687
//Set inner Camera feed width/height
1693-
$("#dialog-camera-live #camfeed").width(dwidth - 30);
1694-
$("#dialog-camera-live #camfeed").height(dheight - 16);
1688+
$("#dialog-camera-live #camfeed").width(width - 30);
1689+
$("#dialog-camera-live #camfeed").height(height - 16);
16951690

16961691
$("#dialog-camera-live").dialog({
16971692
resizable: false,
1698-
width: dwidth + 2,
1699-
height: dheight + 118,
1693+
width: width + 2,
1694+
height: height + 50,
17001695
position: {
17011696
my: "center",
17021697
at: "center",
17031698
of: window
17041699
},
17051700
modal: true,
17061701
title: unescape(Name),
1707-
buttons: {
1708-
"OK": function () {
1709-
$(this).dialog("close");
1710-
}
1711-
},
17121702
open: function () {
17131703
load_cam_video();
17141704
},

0 commit comments

Comments
 (0)