Add "GPU configuration" setting

This commit is contained in:
redphx
2024-07-19 17:41:52 +07:00
parent dbbdc48aab
commit 210fdfbabe
6 changed files with 46 additions and 4 deletions

View File

@@ -8,6 +8,7 @@ export function onChangeVideoPlayerType() {
const playerType = getPref(PrefKey.VIDEO_PLAYER_TYPE);
const $videoProcessing = document.getElementById('bx_setting_video_processing') as HTMLSelectElement;
const $videoSharpness = document.getElementById('bx_setting_video_sharpness') as HTMLElement;
const $videoPowerPreference = document.getElementById('bx_setting_video_power_preference') as HTMLElement;
let isDisabled = false;
@@ -28,6 +29,9 @@ export function onChangeVideoPlayerType() {
$videoProcessing.disabled = isDisabled;
$videoSharpness.dataset.disabled = isDisabled.toString();
// Hide Power Preference setting if renderer isn't WebGL2
$videoPowerPreference.closest('.bx-stream-settings-row')!.classList.toggle('bx-gone', playerType !== StreamPlayerType.WEBGL2);
updateVideoPlayer();
}