2015-06-25 17:50:56 -04:00
|
|
|
|
(function (window) {
|
2015-05-28 01:51:48 -04:00
|
|
|
|
|
|
|
|
|
function update(key, val) {
|
2015-06-25 17:50:56 -04:00
|
|
|
|
appStorage.setItem(key, val);
|
2015-05-28 01:51:48 -04:00
|
|
|
|
|
|
|
|
|
Events.trigger(AppSettings, 'settingupdated', [key]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
window.AppSettings = {
|
|
|
|
|
|
|
|
|
|
maxStreamingBitrate: function (val) {
|
|
|
|
|
|
|
|
|
|
if (val != null) {
|
|
|
|
|
update('preferredVideoBitrate', val);
|
|
|
|
|
}
|
|
|
|
|
|
2015-06-25 17:50:56 -04:00
|
|
|
|
return parseInt(appStorage.getItem('preferredVideoBitrate') || '') || 1500000;
|
2015-05-28 01:51:48 -04:00
|
|
|
|
},
|
|
|
|
|
maxChromecastBitrate: function (val) {
|
|
|
|
|
|
|
|
|
|
if (val != null) {
|
|
|
|
|
update('chromecastBitrate', val);
|
|
|
|
|
}
|
|
|
|
|
|
2015-06-25 17:50:56 -04:00
|
|
|
|
return parseInt(appStorage.getItem('chromecastBitrate') || '') || 3000000;
|
2015-05-28 01:51:48 -04:00
|
|
|
|
},
|
2015-06-07 23:16:42 -04:00
|
|
|
|
enableChromecastAc3: function (val) {
|
|
|
|
|
|
|
|
|
|
if (val != null) {
|
|
|
|
|
update('enablechromecastac3', val.toString());
|
|
|
|
|
}
|
|
|
|
|
|
2015-06-25 17:50:56 -04:00
|
|
|
|
return appStorage.getItem('enablechromecastac3') == 'true';
|
2015-06-07 23:16:42 -04:00
|
|
|
|
},
|
2015-05-28 01:51:48 -04:00
|
|
|
|
enableExternalPlayers: function (val) {
|
|
|
|
|
|
|
|
|
|
if (val != null) {
|
|
|
|
|
update('externalplayers', val.toString());
|
|
|
|
|
}
|
|
|
|
|
|
2015-06-25 17:50:56 -04:00
|
|
|
|
return appStorage.getItem('externalplayers') == 'true';
|
2015-05-28 01:51:48 -04:00
|
|
|
|
},
|
|
|
|
|
enableItemPreviews: function (val) {
|
|
|
|
|
|
|
|
|
|
if (val != null) {
|
|
|
|
|
update('enableItemPreviews', val.toString());
|
|
|
|
|
}
|
|
|
|
|
|
2015-06-25 17:50:56 -04:00
|
|
|
|
return appStorage.getItem('enableItemPreviews') == 'true';
|
2015-05-28 01:51:48 -04:00
|
|
|
|
},
|
|
|
|
|
enableFullScreen: function (val) {
|
|
|
|
|
|
|
|
|
|
if (val != null) {
|
|
|
|
|
update('enableFullScreen', val.toString());
|
|
|
|
|
}
|
|
|
|
|
|
2015-06-25 17:50:56 -04:00
|
|
|
|
return appStorage.getItem('enableFullScreen') == 'true';
|
2015-06-10 00:01:14 -04:00
|
|
|
|
},
|
|
|
|
|
syncPath: function (val) {
|
|
|
|
|
|
|
|
|
|
if (val != null) {
|
|
|
|
|
update('syncPath', val.toString());
|
|
|
|
|
}
|
|
|
|
|
|
2015-06-25 17:50:56 -04:00
|
|
|
|
return appStorage.getItem('syncPath');
|
2015-05-28 01:51:48 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
2015-06-25 17:50:56 -04:00
|
|
|
|
})(window);
|