====== Video ====== The **Video** command let you play cutscenes videos or video overlays effects inside your game.\\ In order to use the video block, drag it from the **[[editor:blocks:2d-models|2D Models]] -> Video** into the [[editor:workflow|workflow]] area and set the **Video URL** parameter.\\ The **Video URL** parameter can be a youtube URL that is not protected or any MP4 file URL on the internet.\\ Cyberix3D doesn't store the video files on its servers and the video will be available only online in the Web / EXE / Android versions.\\ The video will always play at full-screen above the game and you can determine if there will be a skip button for skipping the video.\\ In order to use the video as an overlay effect, you can set the **alpha** parameter to **0.25** (or something else) and you will see your game while the video is playing.\\ The video will not interrupt the game and you can continue playing while the video is playing.\\ When you are using the video as an overlay effect, we recommend hiding the Skip button by set the **Show skip button** parameter to **0**.\\ You can also control the Video Player by using the **[[editor:blocks:variables:set|Set]]** command,\\ By dragging the **[[editor:blocks:variables|Variables]] -> [[editor:blocks:variables:set|Set]]** command into the [[editor:workflow|workflow]] area and set the **Var** parameter to some variable under the **VideoPlayer** class.\\ {{:editor:blocks:2d-models:video.png?800|}} {{:editor:blocks:2d-models:video_var_picker.png?800|}} ===== Performance Issues ===== There might be loading performance issues, especially with the Youtube video URLs.\\ To overcome the problem, when you are using the **Video** command, the video prebuffered automatically when the game loads,\\ So if you need to play the video in the middle of your game there shouldn't be a problem.\\ The disadvantage of using the **[[editor:blocks:variables:set|Set]]** command to control the Video Player is that the video will not be prebuffered and this could lead to slow loading video.\\ ===== Examples ===== * Simple video play [[http://www.gamemaker3d.com/player?pid=01624936|example]] * Video overlay [[http://www.gamemaker3d.com/player?pid=01624935|example]] * Video with controls using the Set command [[http://www.gamemaker3d.com/player?pid=01624988|example]] * Video with prebuffering [[http://www.gamemaker3d.com/player?pid=01625048|example]] ===== Parameters ===== * **On Video Start** - A [[editor:blocks:actions:function|function]] parameter that will run automaticly when the video starts playing. * **On Video End** - A [[editor:blocks:actions:function|function]] parameter that will run automaticly when the video ends. * **On Video Repeat** - A [[editor:blocks:actions:function|function]] parameter that will run automaticly when the video repeats. * **On Video Skipped** - A [[editor:blocks:actions:function|function]] parameter that will run automaticly when the video skipped. * **Video URL** - The URL address for the video. It can be a Youtube video URL that is not protected or any MP4 file URL on the internet. The Supported video formats are MP4, M4V, F4V, 3GPP, FLV. Here is an example for a [[https://www.youtube.com/watch?v=RFinNxS5KN4|Youtube video URL]]. Here is an example for an [[http://www.html5videoplayer.net/videos/toystory.mp4|MP4 video URL]]. * **Visible** - Set the Video Player visibility: **0** - Hide the Video Player. **1** - Show the Video Player. When you set the **Visible** to **0** the video will stop playing automatically. The default value is **1**. * **Play** - Play or pause the video: **0** - Pause the video. **1** - Play the video. The default value is **1**. * **Repeat** - Set the video repeat parameter: **0** - Don't repeat the video when it ends. **1** - Repat the video. The default value is **0**. * **Auto Play** - Set the video autoplay parameter: **0** - Don't play the video automatically. **1** - Play the video automatically. The default value is **1**. * **Duration** - The duration of the video in seconds. This is a read-only parameter. * **Time** - Get or set the current video time in seconds. * **Volume** - Set the video volume between **0** to **1** (**0.5** for example). The default value is **1**. * **Alpha** - Set the video transparency between **0** to **1**. The default value is **1**. * **Show Skip Button** - Show a skip button: **0** - Don't show a skip button. **1** - Show a skip button to skip the video. The default value is **1**. * **Skip Button Label** - The skip button text. The default value is **"Skip"**. * **Skip Button Font Size** - The skip button font size. The default value is **20**. * **Skip Button Position** - The skip button position on the screen. It can be **Top Left**, **Top Right**, **Bottom Left**, **Bottom Right** or **Center**. The default value is **Bottom Right**. * **Skip Button Roundness** - Sets the skip button corners roundness between 0-50. The default value is **10**. {{ :editor:blocks:info-148099_960_720.png?20|}}//MORE INFORMATION// ---- * [[editor:blocks:2d-models:image|]] * [[editor:blocks:2d-models:joystick|]] * [[editor:blocks:2d-models:label|]] * [[editor:blocks:2d-models:list|]] * [[editor:blocks:2d-models:message|]] * [[editor:blocks:2d-models:rectangle|]] * [[editor:blocks:2d-models:round-button|]] * [[editor:blocks:2d-models:text-input|]] * [[editor:blocks:2d-models:button|]]