Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
gdevelop5:objects:video [2019/04/22 00:52]
4ian
gdevelop5:objects:video [2019/06/08 20:18]
piyushpalawat99
Line 1: Line 1:
 # Video object # Video object
  
-A video object ​display ​a video on the screen. It's perfect for cut-scenes in a game.+A video object ​displays ​a video on the screen. It's perfect for cut-scenes in a game.
  
-<note important>​Video files can be very heavy, even for short videos, making your game longer to download and launch. Make sure to use a good compression and limit the length of the video as possible.</​note>​+<note important>​Video files can be very heavy, even for short videos, making your game longer to download and launch. Make sure to use a good compression and limit the length of the video as much as possible.</​note>​
 <note important>​Before a video can be played, you have to ensure that the player interacted first with your game (a simple click/touch on the screen is ok to unlock videos)</​note>​ <note important>​Before a video can be played, you have to ensure that the player interacted first with your game (a simple click/touch on the screen is ok to unlock videos)</​note>​
  
-Videos can be controlled using events: timing, state (play/​paused),​ audio volume....+Videos can be controlled using events: timing, state (play/​paused),​ audio volume...
  
 ## Add a video ## Add a video
Line 12: Line 12:
 When you create a new object, click on "Show Experimental Objects"​ button, then choose Video. When you create a new object, click on "Show Experimental Objects"​ button, then choose Video.
  
-{{ :fr:​gdevelop5:​objects:​wiki_video_object.png?nolink }}+{{ :​gdevelop5:​objects:​video-object.png?​nolink ​|}}
  
 +When the object is created, the editor is shown:
  
-Une fois le type d'​objet choisi la fenêtre des propriétés s'​ouvre,​ à cet endroit vous aller configurer votre objet. +{{ :​gdevelop5:​objects:​video-object-editor.png?nolink |}}
-Dans le cas d'un objet vidéo, nous devrions voir quelque chose comme ceci.+
  
-{{ :​fr:​gdevelop5:​objects:​wiki_video_properties.png?​nolink }}+## Choose a video file
  
-====Modifier les propriétés====+Click on the field "Video resource",​ and then "​Choose a new video file". For compatibility with most browsers, follow these pieces of advice for the video format:
  
- Commencez par sélectionner votre vidéoCliquez dans le champ **Video ressource** et choisissez votre fichier vidéo.+<note important>​File must be a  **.mp4** format encoded as: 
 +  * **H264** for the video, 
 +  * **AAC** for the audio. 
 +</​note>​
  
-<note important>​Votre fichier vidéo doit respecté un format et un codec précis.+You can also choose:
  
-Le fichier doit être un **.mp4** avec les codec suivant ​  +  ​* **Loop the video**: If video is looped when it reaches the end. 
-  * **H264** pour la vidéo ​ +  * **Opacity** : From 0 (fully transparent) to 255 (opaque - default). 
-  * **AAC** pour l'​audio +  * **Volume** : From 0 (silent) to 100 (maximum volume - default) 
-</​note>​+ 
 +<​note>​All the following conditions and actions refer to the conditions and actions in ''​Video''​ category.</​note>​ 
 + 
 +## Duration of video 
 + 
 +The ''​Duration''​ condition tests the length of the video with the value entered depending upon the ''​Sign of the test''​ used. 
 + 
 +## End of video 
 + 
 +To perform an action when the video has reached its end, the ''​Is ended''​ condition is used. This condition might be used to switch from the video to gameplay or something similar. 
 + 
 +## Time of video 
 + 
 +When a video is played during gameplay, there might be instances when the current time of the video has to be checked for actions like enabling 'Skip the video' or popping a 'Save the game' dialog. This can be achieved using the ''​Current time''​ test condition. 
 + 
 +You can also skip to a time in the video using the ''​Set time''​ action. Whenever the condition corresponding to the action is true, the video will skip to time depending upon the time entered and the ''​Modification'​s sign''​. 
 + 
 +## Opacity of video 
 + 
 +Opacity is the measure of the transparency of a video. If the ''​Opacity''​ condition returns 255 it implies that the video is not transparent at all and if it returns 0, it is fully transparent. The default opacity of a video is 255. 
 + 
 +We can set the opacity of a video using the ''​Set opacity''​ action. For maximum, you can set it to 255 while for fully transparent,​ you can set it to 0. 
 + 
 +## Playback speed of the video 
 + 
 +The playback speed of the video is the ratio of the current speed of the video to the original speed of the video. If the ''​Playback speed''​ condition returns a value greater than 1, the video is playing at a rate faster than than the original video. If the condition returns a value less than 1, it is playing at a rate slower than the original video. The default value for playback speed is 1. 
 + 
 +To set the playback speed of a video, use the ''​Set playback speed''​ action. To play the video at a faster rate than the default rate, set a value greater than 1 and to play it at a slower rate, set playback speed to a value less than 1. For default, set it to 1. 
 + 
 +## Looping a video 
 + 
 +When a video is looped, it repeats itself from the beginning after reaching the end. To check if a video is looped or not, use the ''​Is looped''​ condition. If the video is looped, the corresponding action(s) will be performed. 
 + 
 +You can also make a video to loop in GDevelop using the ''​Loop a video''​ action and choosing "​Yes"​ for ''​Activate loop''​. By default, a video is not looped. 
 + 
 +## Muting a video 
 + 
 +When a video is muted, there will be no audio audible from the game. To check if a video is muted, use the ''​Is muted''​ condition. If the video is muted, the corresponding action(s) will be performed. 
 + 
 +You can mute a video using the ''​Mute a video''​ action and choosing "​Yes"​ for ''​Activate mute''​. By default, the video is unmuted. 
 + 
 +## Pausing a video 
 + 
 +To check if a video is paused, use the ''​Is paused''​ condition. If the video is paused, the corresponding action(s) will be performed. 
 + 
 +You can pause a video using the ''​Pause a video''​ action. By default, the video is paused 
 + 
 +## Playing a video
  
-Voyons les autres propriétés :+To see the video, you need to first play the video. To check if the video is playing, use the ''​Is played''​ condition. If the video is playing, the corresponding action(s) will be performed.
  
-  * **Looped** : Cette case vous permet de lire la vidéo en boucle. Si vous la cochez, la vidéo recommencera au début lorsque elle arrive à sa fin, et ce jusqu’à ce que vous l’arrêtiez. +To start a video or resume the video after pausing ityou can use the ''​Play a video''​ actionBy defaultthe video is not playing and needs this action to play.
-  * **Opacity** : Cette case prend une valeur de 0 à 255elle modifie la transparence de la vidéo sur la scène. +
-  * **Volume** : Cette case prend une valeur de 0 à 100elle configure le volume de la vidéo.+
  
-==== Les expressions ==== +## Volume of a video
-Vous pourriez avoir besoin de sauvegarder une valeur correspondant à l'​état d'une vidéo, pour ceci il existe des fonctions pour la vidéo, celle-ci se place dans un champ d'​expressions. +
-Vous trouverez la liste [[gdevelop5:​all-features:​functions#other_available_functions|des fonctions ici]].+
  
- ​[[fr:​gdevelop5:​all-features:​expressions|Pour en savoir plus sur les expressions]].+You can also set the volume of a video using GDevelop. To compare the volume of a video, use the ''​Volume''​ condition. The maximum volume for a video is 100 and the minimum volume is 0 (muted).
  
-==== Exemple ==== +To set the volume of a video, use the ''Set volume''​ conditionYou can set it to any number between 0 to 100. The default volume is set to 100.
-  * Manipulation d'une vidéo avec un lecteur [[https://​editor.gdevelop-app.com/?​project=example://​video-player|Lien]] +
-  * Vidéo avec sous titres géré par les événements (Evénement fonction inclus)+
  
-➡️ Suite **[[fr:​gdevelop5:​objects:​sprite|Objets Sprite]]** !  
  
 +## Examples
 +  * Video player: https://​editor.gdevelop-app.com/?​project=example://​video-player