stream size is adapted to aspect ratio. This closes #2

This commit is contained in:
Aidan Campbell 2016-02-16 18:44:54 -05:00
parent f4a74ea6b1
commit 5234c42e9e

View File

@ -73,9 +73,19 @@ function playGameMode() {
}
function fullscreenNaclModule() {
var streamWidth = 1280; // TODO: once stream size is selectable, use those variables
var streamHeight = 720;
var screenWidth = window.innerWidth;
var screenHeight = window.innerHeight;
var xRatio = screenWidth / streamWidth;
var yRatio = screenHeight / streamHeight;
var zoom = Math.min(xRatio, yRatio);
var body = document.getElementById("nacl_module");
body.width=window.innerWidth;
body.height=window.innerHeight;
body.width=zoom * streamWidth;
body.height=zoom * streamHeight;
}
// user pushed the stop button. we should stop.