-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix VideoStreamPlayer seamless loop #77856
Fix VideoStreamPlayer seamless loop #77856
Conversation
As requested in the contributors chat, here is an audio sample of the VideoStreamPlayer looping seamlessly (warning, might be loud). Audio being looped: Resulting output from Godot: Note that depending on CPU load and complexity of the audio, it still might crack. |
9c53c31
to
270bc93
Compare
Force pushing changes of @KoBeWi to keep git history clean 🙂 |
Thanks! And congrats on your first merged Godot PR! |
As no workarounds are necessary to seamlessly loop videos since godotengine/godot#77856 got merged.
Very nice! Waiting for this thing for like 4 Years to happen XD |
Part of a group of three PRs (#77856 #77857 #77858) that solve godotengine/godot-proposals#264.
This PR enables seamless looping in VideoStreamPlayer nodes with connecting the
on_finished
signal to theplay()
function. Currently doing this will result in a blank frame due to the fact that the internal processing trigger only fires again on the next frame, which means the draw call on the current frame will draw an empty texture. With this change the texture is already updated with the newly started playback, which renders the first frame to the texture instead of leaving it blank, eliminating the one frame flash of transparency of the previous implementation.Before (note the flash of background when the loop restarts):
before.mp4
After (no flash of background):
after.mp4