@@ -1672,43 +1672,33 @@ function ShowCameraLiveStream(Name, camIdx) {
1672
1672
$ ( '#dialog-camera-live #camfeed' ) . attr ( "src" , "images/camera_default.png" ) ;
1673
1673
//$('#dialog-camera-live #camfeed').attr("src", FeedURL);
1674
1674
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
+
1692
1687
//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 ) ;
1695
1690
1696
1691
$ ( "#dialog-camera-live" ) . dialog ( {
1697
1692
resizable : false ,
1698
- width : dwidth + 2 ,
1699
- height : dheight + 118 ,
1693
+ width : width + 2 ,
1694
+ height : height + 50 ,
1700
1695
position : {
1701
1696
my : "center" ,
1702
1697
at : "center" ,
1703
1698
of : window
1704
1699
} ,
1705
1700
modal : true ,
1706
1701
title : unescape ( Name ) ,
1707
- buttons : {
1708
- "OK" : function ( ) {
1709
- $ ( this ) . dialog ( "close" ) ;
1710
- }
1711
- } ,
1712
1702
open : function ( ) {
1713
1703
load_cam_video ( ) ;
1714
1704
} ,
0 commit comments