+4 votes

Hey guys! Converting my.. 30k LOC HTML 5 Game over to Godot.

Working on my intro screen right now, looks like Godot only likes Ogg Vorbis video files which is fine.

Having an issue here

enter image description here

Basically, was looking over the methods for VideoPlayer and cannot find anything that would set the video to loop. I tried Autoplay, which works, but was just curious if this is something the Godot team might support or do we need to build our own function?

King Regards,

in Engine by (306 points)

Hey guys, I got something going:

extends VideoPlayer
func _process(delta):
    var isPlaying = is_playing()
    if isPlaying == false:


func _ready():
    # Called every time the node is added to the scene.
    # Initialization here

    print('Autoplay set to true')


Problem is, there is a slight delay (1-2 seconds) when the video re-starts and it's not seamless. Hmm... Any idea?

3 Answers

0 votes

Check if this help (script attached to parent of VideoPlayer).

var video_player
var video

func _ready():
    video_player = get_node("Panel/VideoPlayer")
    video = preload("res://video.ogv")
    video_player.set_stream( video )
    set_process( true )

func _process(delta):
    if not video_player.is_playing():

Edit: WTF Is wrong with markdown here? Code blocks ``` don't want to work

by (368 points)
edited by

You mean, GitHub Flavoured Markdown ;)

No, every Markdown I've been using. Gihub's one have some nice features but I think backticks are "standard" http://commonmark.org/

0 votes

To get exactly what you need, following your code posted:

extends VideoPlayer        

func _ready(): #{           

func _process(delta): #{
    if not is_playing():

I'm a bit late... hope this helps someone else.

by (16 points)
+3 votes

Attach this to VideoPlayer node:

extends VideoPlayer

func _ready():
    self.connect("finished", self, "_on_Finished")

func _on_Finished():
by (169 points)

Thank you! This script works great for my project.

Thank you so much, this was just what I was looking for.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.