From 1a672cbf5926eb60b30d7ba6525a6b8701c3c2608410df12c4089ab716dacaac Mon Sep 17 00:00:00 2001 From: copecone Date: Sun, 11 Oct 2026 22:51:02 +0900 Subject: [PATCH] Fix Looping Video Background Seeking Every Frame --- Util/VideoBGPlayer.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Util/VideoBGPlayer.cs b/Util/VideoBGPlayer.cs index c27b8b4..def447a 100644 --- a/Util/VideoBGPlayer.cs +++ b/Util/VideoBGPlayer.cs @@ -190,6 +190,14 @@ internal class VideoBGPlayer : MonoBehaviour var vidOffset = scrVfxPlus.instance ? scrVfxPlus.instance.vidOffset : 0.0; var targetVideoTime = songTime + vidOffset; + // When looping is enabled, the playback position is the elapsed time wrapped into [0, Duration). + // When it is disabled, the position keeps increasing and the last frame stays on screen after the end. + var videoDuration = _decoder.Duration; + if (_isLooping && targetVideoTime >= 0 && videoDuration > 0) + { + targetVideoTime %= videoDuration; + } + if (targetVideoTime < 0) { if (_targetTexture)