Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
gdevelop:tutorials:playingvideos [2015/09/26 08:29]
zyanmayfield created
gdevelop:tutorials:playingvideos [2015/09/26 09:26]
zyanmayfield Added how to add videos to preview file
Line 18: Line 18:
 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: 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:
 window.video.play("<​Filename.ext>",​ "​controls"​);​ window.video.play("<​Filename.ext>",​ "​controls"​);​
 +<note tip>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.</​note>​
  
 +{{ :​gdevelop:​tutorials:​addjavascript.jpg?​nolink&​300 |}}
 +
 +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.
 +
 +{{ :​gdevelop:​tutorials:​addimages.jpg?​nolink&​300 |}} 
 +
 +
 +<note important>​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.</​note>​
 +
 +<note tip>If you want you can export to a folder that has local server running out of it to test it quickly. I use [[http://​www.freeutils.net/​source/​jlhttp/​]] it works great for video playback, and even video scanning. </​note> ​