Start VideoPlayer at certain position

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By LukashArts

I have a VideoPlayer in Scene and I would like to start my video at certain position. On user swipe, the same video should start at another position (something like youtube videos with arrow keys).

I was trying to use set_stream_position as is stated in documentation, but it won’t work. The video always starts at the beginning. I also created completely new scene and tried to instantly start from certain position (without swiping), but didn’t succeed.

$ = load(get_current_video()) # path to video
$VideoPlayer.set_stream_position(20) # start video at 20 seconds

I also tried to set stream position and then to play it.

Similar question: - unfortunately they didn’t solve it using set_stream_position (I would also agree on using some other logic if possible)

:bust_in_silhouette: Reply From: Calinou

Seeking isn’t implemented yet, the methods do nothing: VideoPlayer `set_stream_position()` doesn't work (seeking is not implemented) · Issue #14430 · godotengine/godot · GitHub

Any idea if this feature will be implemented in Godot 4?

sttide | 2021-03-06 17:36

We don’t know yet – video playback may be moved out of core to be provided by a FFmpeg-based add-on, given how broken the current implementation is.

Calinou | 2021-03-07 14:36