mirror of
https://github.com/moonlight-stream/moonlight-chrome.git
synced 2025-08-17 16:46:31 +00:00
Now with Quitting apps, and defaults to currently running app. This closes #18
This commit is contained in:
parent
6e26a24939
commit
8bb359714d
@ -15,7 +15,7 @@ function attachListeners() {
|
|||||||
$('#bitrateSlider').on('input', updateBitrateField); // input occurs every notch you slide
|
$('#bitrateSlider').on('input', updateBitrateField); // input occurs every notch you slide
|
||||||
$('#bitrateSlider').on('change', saveBitrate); // change occurs once the mouse lets go.
|
$('#bitrateSlider').on('change', saveBitrate); // change occurs once the mouse lets go.
|
||||||
$('#startGameButton').on('click', startSelectedGame);
|
$('#startGameButton').on('click', startSelectedGame);
|
||||||
|
$('#quitGameButton').on('click', stopGame);
|
||||||
$(window).resize(fullscreenNaclModule);
|
$(window).resize(fullscreenNaclModule);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -118,6 +118,7 @@ function showAppsPushed() {
|
|||||||
opt.innerHTML = appList[i].title;
|
opt.innerHTML = appList[i].title;
|
||||||
$('#selectGame')[0].appendChild(opt);
|
$('#selectGame')[0].appendChild(opt);
|
||||||
}
|
}
|
||||||
|
if (api.currentGame != 0) $('#selectGame')[0].value = api.currentGame;
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
sendMessage('httpInit', [pairingCert.cert, pairingCert.privateKey, myUniqueid]).then(function (ret) {
|
sendMessage('httpInit', [pairingCert.cert, pairingCert.privateKey, myUniqueid]).then(function (ret) {
|
||||||
@ -131,6 +132,7 @@ function showAppsPushed() {
|
|||||||
opt.innerHTML = appList[i].title;
|
opt.innerHTML = appList[i].title;
|
||||||
$('#selectGame')[0].appendChild(opt);
|
$('#selectGame')[0].appendChild(opt);
|
||||||
}
|
}
|
||||||
|
if (api.currentGame != 0) $('#selectGame')[0].value = api.currentGame;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -259,10 +261,22 @@ function fullscreenNaclModule() {
|
|||||||
|
|
||||||
// user pushed the stop button. we should stop.
|
// user pushed the stop button. we should stop.
|
||||||
function stopPushed() {
|
function stopPushed() {
|
||||||
//common.naclModule.postMessage('stopRequested');
|
|
||||||
sendMessage('stopRequested');
|
sendMessage('stopRequested');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function stopGame() {
|
||||||
|
if (api && api.paired) {
|
||||||
|
return api.quitApp();
|
||||||
|
} else {
|
||||||
|
sendMessage('httpInit', [pairingCert.cert, pairingCert.privateKey, myUniqueid]).then(function (ret) {
|
||||||
|
api = new NvHTTP(target, myUniqueid);
|
||||||
|
api.init().then(function (ret) {
|
||||||
|
return api.quitApp();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function storeData(key, data, callbackFunction) {
|
function storeData(key, data, callbackFunction) {
|
||||||
var obj = {};
|
var obj = {};
|
||||||
obj[key] = data;
|
obj[key] = data;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user