Playing videos in Defold?

Hi.
I am looking for a way to insert videos into my game without manually converting all of the videos into a gif sprite and wav. Is there any update on https://github.com/defold/extension-videoplayer or has the windows support been fixed? Target platforms are macOS and Windows, so the videoplayer-native doesn’t help much.
Thank you!
Grify

What you see in those extension repositories is what we have right now. Video playback support hasn’t been requested much in the past.

1 Like

I’ve more or less got this working on MacOS now. I just have a quick question which I’m afraid I don’t know how to answer myself.

The following code, taken from the example, appears to be related to the size of the image.

local logosize = 10
local screen_width = sys.get_config("display.width", 480)
local screen_height = sys.get_config("display.height", 480)
local scale_width = screen_width / logosize
local scale_height = screen_height / logosize

go.set("#sprite", "scale", vmath.vector3(480/12, 480/12, 1) )

If I have a sprite which is 1* 1, and a video which is 240* 240 (and let’s say my game is 640*480), what numbers do i need to put in here (assuming I’d like the video to played at its original size)? What do these variables refer to?

Also: I managed to get the example working, without installing the libraries. Right now, in my own project, I seem to have everything working, i just have some problems with the size. Do I need to install the libraries for each project?

Thanks for your support as usual.

1 Like

…okay, i understand.

The video texture is applied to the sprite in update(), and all of that was just related to keeping a fixed aspect ratio when changing the screen size. All you do is scale the sprite according to the size of the video you are projecting.

Furthermore, it appears that the sprite needs to be in its own atlas, as the image appears to be displayed all versions of that sprite.

By allowing the user to dynamically change the speed and size of the video, Defold have created something very powerful for DJs and VJs. Thanks defold ONCE AGAIN!

2 Likes