|
LifeLua 21-08-2025
Documentation for LifeLua, a Lua interpreter for the PS Vita
|
Playing videos (uses the system's AvPlayer) More...
Plays .MP4 videos (H.264 video with AAC audio). Only one video can be loaded at a time, so these functions don't take a video object; they all control the currently loaded video. All the functions except video.load() raise an error if no video is loaded.
Functions | |
| nil | video.load (string path, boolean autostart, boolean loop) |
| nil | video.output () |
| boolean | video.active () |
| nil | video.pause () |
| nil | video.resume () |
| number | video.elapsed () |
| nil | video.seek (number seconds) |
| nil | video.stop () |
| nil | video.close () |
| boolean video.active | ( | ) |
Checks if the video is playing
true while the video is playing, false once it has ended or was stopped | nil video.close | ( | ) |
Closes the video and frees its memory, so another one can be loaded
| number video.elapsed | ( | ) |
Gets how far the video has played
| nil video.load | ( | string | path, |
| boolean | autostart, | ||
| boolean | loop ) |
Loads a video. Does nothing if a video is already loaded (close it first with video.close()).
| path | Path to the video file |
| autostart | true to start playing right away (optional, default: false) |
| loop | true to start over every time it ends (optional, default: false) |
| nil video.output | ( | ) |
Draws the current video frame, scaled to fill the screen's height and centered. Call it every frame, before draw.swapbuffers().
| nil video.pause | ( | ) |
Pauses the video
| nil video.resume | ( | ) |
Resumes a paused video
| nil video.seek | ( | number | seconds | ) |
Jumps to a position in the video
| seconds | Position to jump to, in seconds from the start |
| nil video.stop | ( | ) |
Stops the video. Call video.close() afterwards to free it.