Differences

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

Link to this comparison view

Last revision Both sides next revision
gdevelop:tutorials:playingvideos [2015/09/26 08:29]
zyanmayfield created
gdevelop:tutorials:playingvideos [2015/09/26 08:40]
zyanmayfield Finishing Tutorial
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 even and drag the JavaScript Code box underneath it. When I click the mouse the video will play.
 +
 +<note important>​This will not work in the preview because I have not figure out how to get the video files into the correct place to be played. I export the Web Platform 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> ​