I'd like to know if and how it is possible for me to play a video in my Godot game. Specifically I'd like to know what video file format I need to use and what code I have to write to play that video back fullscreen.
-
\$\begingroup\$ -1 "This question does not show any research effort". You obviously did not search the web. \$\endgroup\$– Vaillancourt ♦Jan 18, 2017 at 11:51
-
\$\begingroup\$ I tried searching, but can't find anything. \$\endgroup\$– ryank135Jan 18, 2017 at 12:36
-
\$\begingroup\$ ryank135 , please show / tell us what you have tried to upload the videos , \$\endgroup\$– user6668201Jan 18, 2017 at 14:09
-
2\$\begingroup\$ "Yes or no" questions are generally a bad fit for this site, so instead I have edited your question to ask how. I did, however, assume you want to play the video back fullscreen. If you want to do something else, like play it on the surface of some 3D object, you should edit the question to account for that. \$\endgroup\$– user1430Jan 18, 2017 at 16:35
-
\$\begingroup\$ This question is a lot more useful with the amendments. \$\endgroup\$– GnemlockJan 18, 2017 at 19:52
1 Answer
Godot has a VideoPlayer
API that is suitable for this purpose.
Once you create a VideoPlayer
node, you can use the set_stream
function to assign the desired video stream. You can load such a stream using the load
function: load("some/path/to/your/video.ogv")
.
Note that VideoPlayer
only supports the OGV Theora format.