mirror of
https://github.com/moonlight-stream/moonlight-chrome.git
synced 2025-08-17 16:46:31 +00:00
stream size is adapted to aspect ratio. This closes #2
This commit is contained in:
parent
f4a74ea6b1
commit
5234c42e9e
@ -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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user