Plus Lua API
Video callbacks
This page documents the Lua callbacks exposed by LuaVideo.hx and the
internal variables that control video sprite playback, placement, and cleanup.
Video callbacks
playLuaVideoSprite(tag, path, x, y, front)creates and plays a video sprite.pauseLuaVideo(tag)pauses the active video assigned to the tag.resumeLuaVideo(tag)resumes the active video assigned to the tag.removeLuaVideo(tag)requests a safe removal of the video sprite.forceRemoveLuaVideo(tag)bypasses the delayed removal guard.luaVideoExists(tag)checks whether the tagged video exists.isLuaVideoPlaying(tag)returns the current playback state.setLuaVideoVolume(tag, volume)adjusts the playback volume.getLuaVideoDuration(tag)returns the full duration in seconds.getLuaVideoTime(tag)returns the current playback position in seconds.
Video variables
tagUnique key used to store and retrieve the video sprite.
pathMedia path resolved with
Paths.video(path).
xHorizontal position applied after the video format is ready.
yVertical position applied after the video format is ready.
frontIf true, the video is added above the playfield stack.
volumeNormalized playback volume used by setLuaVideoVolume.
activeVideosInternal map that tracks active video sprites.
allowDestroyInternal guard that delays destruction until the sprite is ready.
isDestroyedInternal flag that prevents double-destroy operations.
tag
path
x
y
front
volume
activeVideos
allowDestroy
isDestroyed
Notes
VIDEOS_ALLOWEDmust be enabled at build time.onVideoFinished(tag)fires when the video reaches the end.forceRemoveLuaVideo(tag)is useful when cleanup must happen immediately.- This documentation is ready for more video examples later.