Graduate

Update index.html UI

...@@ -63,15 +63,16 @@ function init() ...@@ -63,15 +63,16 @@ function init()
63 var screenHeight = $(document).height(); 63 var screenHeight = $(document).height();
64 var headerHeight = $('#header').height(); 64 var headerHeight = $('#header').height();
65 var messageboxHeight = $('#messagebox').height(); 65 var messageboxHeight = $('#messagebox').height();
66 + var ratio = 1.0;
66 video.width = video.videoWidth; 67 video.width = video.videoWidth;
67 video.height = video.videoHeight; 68 video.height = video.videoHeight;
68 if (video.width > screenWidth || video.height + headerHeight > screenHeight){ 69 if (video.width > screenWidth || video.height + headerHeight > screenHeight){
69 - var ratio = Math.min(screenWidth / video.width * 1.0, screenHeight / ((video.height + headerHeight) * 1.0)); 70 + ratio = Math.min(screenWidth / video.width * 1.0, screenHeight / ((video.height + headerHeight) * 1.0));
71 + }
70 container.style.width = Math.round(video.width * ratio) + 'px'; 72 container.style.width = Math.round(video.width * ratio) + 'px';
71 container.style.height = Math.round(video.height * ratio) + 'px'; 73 container.style.height = Math.round(video.height * ratio) + 'px';
72 canvasOutput.width = Math.round(video.width * ratio); 74 canvasOutput.width = Math.round(video.width * ratio);
73 canvasOutput.height = Math.round(video.height * ratio); 75 canvasOutput.height = Math.round(video.height * ratio);
74 - }
75 load_cascade(); 76 load_cascade();
76 }); 77 });
77 }).catch(function (err0r) { 78 }).catch(function (err0r) {
......