mirror of
https://github.com/moonlight-stream/moonlight-chrome.git
synced 2025-08-18 09:06:47 +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() {
|
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");
|
var body = document.getElementById("nacl_module");
|
||||||
body.width=window.innerWidth;
|
body.width=zoom * streamWidth;
|
||||||
body.height=window.innerHeight;
|
body.height=zoom * streamHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
// user pushed the stop button. we should stop.
|
// user pushed the stop button. we should stop.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user