mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-06-07 16:17:20 +02:00
Check support of RTCRtpTransceiver.setCodecPreferences()
This commit is contained in:
parent
0fe99f8f2d
commit
2cea30cf16
@ -607,6 +607,12 @@ function injectSettingsButton($parent) {
|
|||||||
|
|
||||||
setting.value = PREFS.get(setting.id);
|
setting.value = PREFS.get(setting.id);
|
||||||
$control.checked = setting.value;
|
$control.checked = setting.value;
|
||||||
|
|
||||||
|
if (setting.id === Preferences.USE_DESKTOP_CODEC && !hasRtcSetCodecPreferencesSupport()) {
|
||||||
|
$control.disabled = true;
|
||||||
|
$control.checked = false;
|
||||||
|
$control.title = 'Not supported by this browser';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const $elm = CE('div', {'class': 'setting_row'},
|
const $elm = CE('div', {'class': 'setting_row'},
|
||||||
@ -841,8 +847,17 @@ function patchVideoApi() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function hasRtcSetCodecPreferencesSupport() {
|
||||||
|
return (typeof RTCRtpTransceiver !== 'undefined' && 'setCodecPreferences' in RTCRtpTransceiver.prototype)
|
||||||
|
}
|
||||||
|
|
||||||
function patchRtcCodecs() {
|
function patchRtcCodecs() {
|
||||||
if (typeof RTCRtpTransceiver === 'undefined' || !PREFS.get(Preferences.USE_DESKTOP_CODEC)) {
|
if (!PREFS.get(Preferences.USE_DESKTOP_CODEC)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!hasRtcSetCodecPreferencesSupport()) {
|
||||||
|
console.log('[Better xCloud] RTCRtpTransceiver.setCodecPreferences() is not supported');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user