Construct 2 Release r171

New this build: three new plugins - video, slider bar and progress bar! There's also a new tagging feature for shadows so more advanced effects are possible, particularly with having different shadows at different levels of Z order (e.g. scenery covering up an object which can also cast its own shadow underneath itself).

Slider and progress bars

These new form controls are pretty straightforward. The slider bar has a slider along a line which you can use to select a value between a minimum and maximum. The progress bar is a browser-styled bar (so it looks in keeping with the rest of the browser/OS, like a native control) which can be used to display a percentage of progress. It also supports an indeterminate state, when progress is unknown (e.g. waiting for a connection to complete), but note iOS does not support intererminate progress bars.

Unfortunately Internet Explorer 9 does not support either of these controls, but IE10+ and all other browsers do, and the share of IE9 is pretty small now so should not pose a problem.

Video plugin

This new official Video plugin allows for video playback in Construct 2 games. Unlike the form controls it actually renders inside the game, meaning other objects can be placed on top of it, and you can even apply effects to it in WebGL mode. However again iOS is an exception: iOS does not support rendering videos to canvases, so on iOS the video will float above the game like a form control. On Safari for iPhone it's even worse and it absolutely insists on playing video fullscreen. This behavior is forced by the Safari browser and there's no way around it: as soon as the video starts playing, it brings the video up in to fullscreen and adds playback controls. For watching something like a cutscene it might be OK, but for other purposes it might be less useful. We've reported the issue to Apple and hopefully this is something that can be changed in iOS 8.

On Safari for iOS and Chrome for Android, note that like with music, video playback can only begin in a user input event. If you set the video's 'Autoplay' property to 'Yes', on these platforms it will wait until the first touch event and start the video then. Even when using the 'Play' action, it will be ignored unless it's in a user input trigger like 'On any touch start'. Bear this in mind.

Regarding video formats, as with audio, browser makers simply cannot agree on one video format that can play in all browsers. The most widely supported is H.264, but it still does not reach all platforms. It is also patent-encumbered so there could be fees to use the encoders, especially for commercial purposes. WebM or Ogg Theora can play reliably in most browsers except for Internet Explorer and Safari, but it is a free format without patent restrictions or fees. Therefore as with our audio support, the video plugin will attempt to play the free formats first, and fall back to H.264 last. The flow goes like this: if a WebM source is provided and WebM is supported by the browser, play that; else if an Ogg Theora source is provided and Ogg Theora is supported by the browser, play that; else if a H.264 source is provided and H.264 is supported by the browser, play that. Note pretty much every browser that supports WebM also supports Ogg Theora, so you should only need a WebM source or an Ogg Theora source (no need for both), and a H.264 fallback. If you don't have a source for a free format, or you don't have a H.264 source, some platforms will not be able to play the video. If you know your platform in advance though, that's OK - node-webkit can play WebM, and Windows Store apps only play H.264.

Due to the complexities of the patent-encumbered H.264 and the wide array of video formats in common use, Construct 2 does not provide a video importer like it provides for audio. You must encode the videos yourself and import them as project files. Also note you will need to set the following MIME types for the server if hosting videos for browser games: video/webm for .webm videos, video/ogg for .ogv videos, and video/mp4 for .mp4 (H.264) videos.