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)