mirror of
https://github.com/moonlight-stream/moonlight-chrome.git
synced 2025-08-17 16:46:31 +00:00
now with a proper UI reset after closing a stream. this closes #19
This commit is contained in:
parent
cce49d66b2
commit
617afd2d4f
@ -147,10 +147,10 @@ function showAppsPushed() {
|
|||||||
|
|
||||||
function showAppsMode() {
|
function showAppsMode() {
|
||||||
console.log("entering show apps mode.");
|
console.log("entering show apps mode.");
|
||||||
$('#streamSettings').css('display', 'none');
|
$(".mdl-layout__header").show();
|
||||||
$('#hostSettings').css('display', 'none');
|
$("#main-content").children().not("#listener").show();
|
||||||
$('#gameSelection').css('display', 'inline-block');
|
$("#main-content").removeClass("fullscreen");
|
||||||
$("#main-content").children().not("#listener").css('display', 'inline-block');
|
$("#listener").removeClass("fullscreen");
|
||||||
$("body").css('backgroundColor', 'white');
|
$("body").css('backgroundColor', 'white');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -202,12 +202,13 @@ function startSelectedGame() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function playGameMode() {
|
function playGameMode() {
|
||||||
|
console.log("entering play game mode");
|
||||||
$(".mdl-layout__header").hide();
|
$(".mdl-layout__header").hide();
|
||||||
$("#main-content").children().not("#listener").hide();
|
$("#main-content").children().not("#listener").hide();
|
||||||
$("#main-content").addClass("fullscreen");
|
$("#main-content").addClass("fullscreen");
|
||||||
$("#listener").addClass("fullscreen");
|
$("#listener").addClass("fullscreen");
|
||||||
fullscreenNaclModule();
|
fullscreenNaclModule();
|
||||||
document.body.style.backgroundColor = "black";
|
$("body").css('backgroundColor', 'black');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Maximize the size of the nacl module by scaling and resizing appropriately
|
// Maximize the size of the nacl module by scaling and resizing appropriately
|
||||||
|
@ -15,10 +15,13 @@ var sendMessage = function(method, params) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function handleMessage(msg) {
|
function handleMessage(msg) {
|
||||||
if (msg.data.callbackId && callbacks[msg.data.callbackId]) {
|
if (msg.data.callbackId && callbacks[msg.data.callbackId]) { // if it's a callback, treat it as such
|
||||||
callbacks[msg.data.callbackId][msg.data.type](msg.data.ret);
|
callbacks[msg.data.callbackId][msg.data.type](msg.data.ret);
|
||||||
delete callbacks[msg.data.callbackId]
|
delete callbacks[msg.data.callbackId]
|
||||||
} else {
|
} else { // else, it's just info, or an event
|
||||||
console.log(msg.data);
|
console.log(msg.data);
|
||||||
|
if(msg.data === 'streamTerminated') { // if it's a recognized event, notify the appropriate function
|
||||||
|
showAppsMode();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user