New setting: "combine audio & video streams"

This commit is contained in:
redphx 2024-04-07 11:44:30 +07:00
parent 9f26021ec6
commit 93b540d995

View File

@ -7166,6 +7166,8 @@ class Preferences {
static get USER_AGENT_CUSTOM() { return 'user_agent_custom'; } static get USER_AGENT_CUSTOM() { return 'user_agent_custom'; }
static get STREAM_SIMPLIFY_MENU() { return 'stream_simplify_menu'; } static get STREAM_SIMPLIFY_MENU() { return 'stream_simplify_menu'; }
static get STREAM_COMBINE_SOURCES() { return 'stream_combine_sources'; }
static get STREAM_TOUCH_CONTROLLER() { return 'stream_touch_controller'; } static get STREAM_TOUCH_CONTROLLER() { return 'stream_touch_controller'; }
static get STREAM_TOUCH_CONTROLLER_AUTO_OFF() { return 'stream_touch_controller_auto_off'; } static get STREAM_TOUCH_CONTROLLER_AUTO_OFF() { return 'stream_touch_controller_auto_off'; }
static get STREAM_TOUCH_CONTROLLER_STYLE_STANDARD() { return 'stream_touch_controller_style_standard'; } static get STREAM_TOUCH_CONTROLLER_STYLE_STANDARD() { return 'stream_touch_controller_style_standard'; }
@ -7397,6 +7399,12 @@ class Preferences {
'default': false, 'default': false,
}, },
[Preferences.STREAM_COMBINE_SOURCES]: {
'default': false,
'experimental': true,
'note': t('combine-audio-video-streams-summary'),
},
[Preferences.STREAM_TOUCH_CONTROLLER]: { [Preferences.STREAM_TOUCH_CONTROLLER]: {
'default': 'all', 'default': 'all',
'options': { 'options': {
@ -8221,6 +8229,16 @@ if (gamepadFound) {
funcStr = funcStr.replace(text, newCode + text); funcStr = funcStr.replace(text, newCode + text);
return funcStr; return funcStr;
}, },
streamCombineSources: function(funcStr) {
const text = 'this.useCombinedAudioVideoStream=!!this.deviceInformation.isTizen';
if (!funcStr.includes(text)) {
return false;
}
funcStr = funcStr.replace(text, 'this.useCombinedAudioVideoStream=true');
return funcStr;
},
}; };
static #PATCH_ORDERS = [ static #PATCH_ORDERS = [
@ -8274,6 +8292,8 @@ if (gamepadFound) {
'disableGamepadDisconnectedScreen', 'disableGamepadDisconnectedScreen',
ENABLE_NATIVE_MKB_BETA && 'mkbMouseAndKeyboardEnabled', ENABLE_NATIVE_MKB_BETA && 'mkbMouseAndKeyboardEnabled',
], ],
getPref(Preferences.STREAM_COMBINE_SOURCES) && ['streamCombineSources'],
]; ];
static #patchFunctionBind() { static #patchFunctionBind() {
@ -10480,6 +10500,7 @@ function setupSettingsUi() {
[Preferences.SCREENSHOT_APPLY_FILTERS]: t('screenshot-apply-filters'), [Preferences.SCREENSHOT_APPLY_FILTERS]: t('screenshot-apply-filters'),
[Preferences.AUDIO_ENABLE_VOLUME_CONTROL]: t('enable-volume-control'), [Preferences.AUDIO_ENABLE_VOLUME_CONTROL]: t('enable-volume-control'),
[Preferences.STREAM_COMBINE_SOURCES]: t('combine-audio-video-streams'),
}, },
[t('local-co-op')]: { [t('local-co-op')]: {
@ -10582,7 +10603,7 @@ function setupSettingsUi() {
if (!settingNote) { if (!settingNote) {
settingNote = t('experimental') settingNote = t('experimental')
} else { } else {
settingNote = `[🧪 ${t('experimental')}] ${settingNote}` settingNote = `${t('experimental')}: ${settingNote}`
} }
} }