This tutorial will show you how to play videos in your game using java script. This method was made by my brother Zeal Mayfield. It works on Chrome I haven't tested it in other browsers.

First start by enabling JavaScript in your game. Right click on your project icon and select “Edit the property of the game”

Next you will need to download the java script code file below to your computer.

In GDevelop add this file as a source code by right clicking on the source file and selecting “Add an already existing source file”.

It will open a browser locate the file you just downloaded and select it and press “Open”. Don't quote me on this but this file allows for the use of JQuery which is a Java Script Library so we can easily write simple code to display a video later.

OK to create the Java Script to play the video Cick “Events” then on the bar above “Add” then “JavaScrip Code(Web platform only)” and type:“<Filename.ext>”, “controls”);

If you don't remove the comma and “controls” the video will just auto play. There is more options you can add with controls being displayed, auto start and different things maybe someone can add those to this wiki later.

A JavaScript box will appear now you can create a condition, you can see I chose on click. Create a SubEvent on that event and drag the JavaScript Code box underneath it.

UNTESTED: Before you can preview it and test it out you will need to add the video file to the preview folder, you can do this by clicking the image icon and then selecting add image the add image button will not work unless you have the image tab open. When adding the image be sure to select to display all files as seen in the picture.

This will not work in the preview because the video file is not placed in the preview folder. I export the Web Platform game and then just put the videos I'm using inside the main folder.
If you want you can export to a folder that has local server running out of it to test it quickly. I use it works great for video playback, and even video scanning.