[Solved] Videos can only be played once

So I added a LOT of cutscene into my game in form of a video, and everything works fine when it played for the first time. But when I lose and press the restart button all of the the videos doesn’t play and only the audio can be heard. Idk if this is a bug or not, but if you ever experience this please tell me how to fix it.

How do you restart ? You use “Change scene” , or you teleport your player at the start ?

Also try using the action “Set time” at 0 before playing the videos.

I reproduced the issue. Indeed, when changing scenes, one would expect that all videos come back to the first frame.

This will be fixed in next version (See Add stop method on video and use it when object is destroyed by AlexandreSi · Pull Request #5833 · 4ian/GDevelop · GitHub)

In the meantime, you can use @vfabien21’s suggestion.

Thanks for taking the time to report this issue!

Also try using the action “Set time” at 0 before playing the videos.

I’ve done it before, but when I do that the video wouldn’t even play.

Indeed… I have tried it and “Set Time” seems to do nothing and to stop (crash ?) the video.
Have you tried looping the video ?

Do you get the same result with the time setting action before the play action?

I did but It’s kinda broke the cutscene since you can use “When video is ended” condition when the video is looped so I forced to use “Wait X Second” action to change the scene which is suck because there is a chance where the scene changes in the middle of the cutscene before it’s ended due to lag or the video plays late.

Nope, but that straight up didn’t work at all and the video still can only be played once.

Would it be possible for you to create a small project where the bug is present and send it over so that I can have a look?

EDIT: I created a small project with some actions to play/pause/set time at 0 and everything worked fine (after my code change mentioned above though). So if I have a project with the bug you described and instructions to reproduce the bug, I could check that my code change fixes your issue or not.

Sure, but maybe I’ll just send you the project that I’m working on instead which is exactly where the bug happened, I tried to create a small project and use “Set time” action like @vfabien21 said but this time it’s actually work and the video plays normally so I assumed that the bug only happens in the project that i’m working on.

https://www.mediafire.com/file/fjog0foo7y5mbav/mememaster.rar/file

Ok so I checked, my code change above will fix the issues you have on your project and you won’t have to manually set the time to 0. So please wait for the next release (coming next week).

Regarding the manual time setting, there is also a bug (related to HTML5 videos) when setting the time to 0 while loading the video. For the moment, I won’t take care of it since you ended up doing this as a hack, we’ll see if others complain about this.

Thanks for sending your project over so that I could check!

Thank you so much man, can’t wait for the next release to come out! :slight_smile:

1 Like