Video playback in Lightact is very straightforward yet quite flexible. It is all done with 4 nodes:
 Â
 Â
 Â
Video reader, Video playlist reader, Hap reader and Hap playlist reader.
The first 2 nodes can play videos in a variety of containers and codecs. A more detailed list is available in Supported codecs and containers article. The last 2 nodes, however, are dedicated to the playback of .avi files encoded with one of high-performance Hap codecs (Hap, HapA or HapQ). For more information about Hap, please head to Converting to Hap article.
An example of a layout that plays a video file is shown below:
Reader nodes
This applies to both Video reader node and Hap video reader node. These 2 nodes are designed to either play one of the imported video assets or a video file in the Filepath string input. If you select the node, you can choose what the node should play in the Source section on the right.
None or Filepath will play the video file that’s located at the Filepath string input. If the node can’t find a playable video file at that file path, it won’t play anything.
Inputs
- Loop:if it is checked, the video file will start from the Start at position when it reaches End at position.
- Volume: determines the audio volume.
- Start at: determines the starting position where the video should start.
- End at: determines the position where the video should stop playing or, if Loop is true, jump back to Start at.
- Fade in: determines the fade in time in seconds starting from Start at.
- Fade out: determines the fade-out time in seconds starting backward from End at.
- Ignore pause: if it is checked, the video will play even if Lightact is paused.
- Always begin at Start at: if it is checked, the video will always begin at Start at position even if the current layer time is more than 0. This can be useful if you want to change the Filepath input in the middle of a playback. If this input is false, the starting position will be governed by the current position of the playhead on the layer.
Outputs
- Output: outputs the video texture.
- Frame: outputs the current frame number.
- Position: outputs the current position in the video file in seconds.
- Duration: outputs the duration of the movie in seconds.
- Loops: is a counter of how many times the video has looped.
- isPlaying: is true when the video file is playing. Sometimes it can take a few frames for this to reflect the latest state.
Playlist reader nodes
This applies to Video playlist reader node as well as Hap video playlist reader node. These 2 nodes are designed to play all videos given in the Filepaths string array input. Usually this input is provided by Filepaths from folder node as shown below.
For more information about Filepaths from folder node, please scroll to the bottom of the article.
Inputs
- Volume: it determines the audio volume.
- Fade in: it determines the fade in time in seconds starting from Start at.
- Fade out: it determines the fade-out time in seconds starting backward from End at.
- Ignore pause: if it is checked, the video will play even if Lightact is in paused.
- Loop: if it is checked, the playlist will start from the beginning when the last file is played to the end.
Outputs
- Output: outputs the video texture.
- File index: outputs the index of the current file in the Filepaths array.
- Frame: outputs the current frame number.
- Position: outputs the current position in the video file in seconds.
- Duration: outputs the duration of the movie in seconds.
- Loops: is a counter of how many times the video has looped.
- isPlaying: is true when the video file is playing. Sometimes it can take a few frames for this to reflect the latest state.
Filepaths from folder node
This node finds all files in a folder and puts its complete file paths into the Filepaths output. The node refreshes Filepaths output every Timeout seconds.
You can adjust this property on the node’s properties on the right (minimum is 10 seconds).
Inputs
- Folder: in this string input you should put a path to a folder without the last backslash. A valid path is, for example, D:\My Videos\testFolder.
- Extensions: if it is left empty, all files will be returned. If you insert one or more extensions, only files with these extensions will be returned. Use space as the delimiter.
- Check subfolders: if this is true, the node will return files in subfolders of the given folder as well. If it is false, it will return only files in the folder itself (ignoring all subfolders).
Outputs
- Filepaths: an array of strings each representing one file path.
- Length: the number of found files.
- Success: false if there was an error during the operation.
- Error: a description of the error in case Success was false.