Don't call animate() when hiding renderer

This commit is contained in:
redphx
2024-10-14 16:47:03 +07:00
parent 1acb30e3af
commit 9f440e9cf4
4 changed files with 21 additions and 7 deletions

View File

@@ -45,8 +45,7 @@ export function onChangeVideoPlayerType() {
}
export function limitVideoPlayerFps() {
const targetFps = getPref(PrefKey.VIDEO_MAX_FPS);
export function limitVideoPlayerFps(targetFps: number) {
const streamPlayer = STATES.currentStream.streamPlayer;
streamPlayer?.getWebGL2Player()?.setTargetFps(targetFps);
}
@@ -58,7 +57,7 @@ export function updateVideoPlayer() {
return;
}
limitVideoPlayerFps();
limitVideoPlayerFps(getPref(PrefKey.VIDEO_MAX_FPS));
const options = {
processing: getPref(PrefKey.VIDEO_PROCESSING),