mirror of
https://github.com/moonlight-stream/moonlight-chrome.git
synced 2025-08-17 16:46:31 +00:00
now with default bitrate settings. This closes #12
This commit is contained in:
parent
61d072f026
commit
061cc7edd4
@ -137,10 +137,12 @@ function storeData(key, data, callbackFunction) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function saveResolution() {
|
function saveResolution() {
|
||||||
|
updateDefaultBitrate();
|
||||||
storeData('resolution', $('#selectResolution')[0].value, null);
|
storeData('resolution', $('#selectResolution')[0].value, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
function saveFramerate() {
|
function saveFramerate() {
|
||||||
|
updateDefaultBitrate();
|
||||||
storeData('frameRate', $('#selectFramerate')[0].value, null);
|
storeData('frameRate', $('#selectFramerate')[0].value, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -152,6 +154,27 @@ function saveBitrate() {
|
|||||||
storeData('bitrate', $('#bitrateSlider')[0].value, null);
|
storeData('bitrate', $('#bitrateSlider')[0].value, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function updateDefaultBitrate() {
|
||||||
|
var res = $('#selectResolution')[0].value;
|
||||||
|
var frameRate = $('#selectFramerate')[0].value;
|
||||||
|
|
||||||
|
if (res.lastIndexOf("1920:1080", 0) === 0) {
|
||||||
|
if (frameRate.lastIndexOf("30", 0) === 0) { // 1080p, 30fps
|
||||||
|
$('#bitrateSlider')[0].MaterialSlider.change('10');
|
||||||
|
} else { // 1080p, 60fps
|
||||||
|
$('#bitrateSlider')[0].MaterialSlider.change('15');
|
||||||
|
}
|
||||||
|
} else if (res.lastIndexOf("1280:720") === 0) {
|
||||||
|
if (frameRate.lastIndexOf("30", 0) === 0) { // 720, 30fps
|
||||||
|
$('#bitrateSlider')[0].MaterialSlider.change('5');
|
||||||
|
} else { // 720, 60fps
|
||||||
|
$('#bitrateSlider')[0].MaterialSlider.change('10');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
updateBitrateField();
|
||||||
|
saveBitrate();
|
||||||
|
}
|
||||||
|
|
||||||
function onWindowLoad(){
|
function onWindowLoad(){
|
||||||
// don't show the game selection div
|
// don't show the game selection div
|
||||||
document.getElementById('gameSelection').style.display = 'none';
|
document.getElementById('gameSelection').style.display = 'none';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user