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,
Hey guys, I got something going:
extends VideoPlayer
func _process(delta):
var isPlaying = is_playing()
if isPlaying == false:
play()
pass
func _ready():
# Called every time the node is added to the scene.
# Initialization here
set_process(true)
set_autoplay(true)
print('Autoplay set to true')
print(has_autoplay())
pass
Problem is, there is a slight delay (1-2 seconds) when the video re-starts and it’s not seamless. Hmm… Any idea?
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():
video_player.play()
Edit: WTF Is wrong with markdown here? Code blocks ``` don’t want to work
You mean, GitHub Flavoured Markdown
Bojidar Marinov | 2016-03-11 20:33
No, every Markdown I’ve been using. Gihub’s one have some nice features but I think backticks are “standard” http://commonmark.org/