Module that handles video files playback.
More...
Module that handles video files playback.
◆ PlayMode
Play modes for video playback.
Enumerator |
---|
NORMAL_MODE | Normal speed with audio.
|
FAST_FORWARD_2X_MODE | Fast Forward at 2x speed without audio.
|
FAST_FORWARD_4X_MODE | Fast Forward at 4x speed without audio.
|
FAST_FORWARD_8X_MODE | Fast Forward at 8x speed without audio.
|
FAST_FORWARD_16X_MODE | Fast Forward at 16x speed without audio.
|
FAST_FORWARD_32X_MODE | Fast Forward at 32x speed without audio.
|
◆ init()
void Video::init |
( |
void |
| ) |
|
Init video sub-system.
- Usage example:
Definition luaVideo.cpp:19
void init(void)
Init video sub-system.
◆ term()
void Video::term |
( |
void |
| ) |
|
Terminate video sub-system.
- Usage example:
void term(void)
Terminate video sub-system.
◆ open()
void Video::open |
( |
string |
filename, |
|
|
bool |
loop |
|
) |
| |
Open an MP4 video file.
- Usage example:
void open(string filename, bool loop)
Open an MP4 video file.
- Parameters
-
filename | - Filepath of the file to reproduce. |
loop | - If true, playback will loop (optional). |
◆ close()
void Video::close |
( |
void |
| ) |
|
Close the current video playback.
- Usage example:
void close(void)
Close the current video playback.
◆ getOutput()
int Video::getOutput |
( |
void |
| ) |
|
Get the current video frame as image.
- Usage example:
if frame ~= 0 then
end
Definition luaGraphics.cpp:25
void drawImage(number x, number y, int img, int color)
Draw an image.
int getOutput(void)
Get the current video frame as image.
- Returns
- The current video frame, 0 if no frame is available.
- Note
- Returned image became invalid when Video.term is called.
◆ pause()
void Video::pause |
( |
void |
| ) |
|
Pause current video playback.
- Usage example:
void pause(void)
Pause current video playback.
◆ resume()
void Video::resume |
( |
void |
| ) |
|
Resume current video playback.
- Usage example:
void resume(void)
Resume current video playback.
◆ isPlaying()
bool Video::isPlaying |
( |
void |
| ) |
|
Get current playback state.
- Usage example:
end
bool isPlaying(void)
Get current playback state.
- Returns
- true if playing, false otherwise.
◆ setVolume()
void Video::setVolume |
( |
int |
volume | ) |
|
Set internal volume for current video playback.
- Usage example:
void setVolume(int volume)
Set internal volume for current video playback.
- Parameters
-
volume | - Volume value to set. |
- Note
- volume must be in a range of 0 and 32767.
◆ getVolume()
int Video::getVolume |
( |
void |
| ) |
|
Get internal volume for current video playback.
- Usage example:
- Returns
- Volume value of the current video playback.
◆ getTime()
number Video::getTime |
( |
void |
| ) |
|
Get current time for current video playback.
- Usage example:
- Returns
- Current time position in the video playback in milliseconds.
◆ jumpToTime()
void Video::jumpToTime |
( |
number |
time | ) |
|
Jump to a specific position for current video playback.
- Usage example:
number getTime(void)
Get current time for current video playback.
void jumpToTime(number time)
Jump to a specific position for current video playback.
- Parameters
-
time | - The position in milliseconds where to jump in the video playback. |
◆ setPlayMode()
void Video::setPlayMode |
( |
PlayMode |
mode | ) |
|
Set play mode for current video playback.
- Usage example:
void setPlayMode(PlayMode mode)
Set play mode for current video playback.
@ FAST_FORWARD_16X_MODE
Fast Forward at 16x speed without audio.
Definition luaVideo.cpp:15
- Parameters
-
◆ openSubs()
void Video::openSubs |
( |
string |
fname | ) |
|
Open a subtitles file for current video playback.
- Usage example:
void openSubs(string fname)
Open a subtitles file for current video playback.
- Parameters
-
fname | - The file to use as subtitles source. |
- Note
- Supported subtitles formats: .srt, .vtt.
◆ closeSubs()
void Video::closeSubs |
( |
| ) |
|
Close currently opened subtitles file.
- Usage example:
void closeSubs()
Close currently opened subtitles file.
◆ getSubs()
string Video::getSubs |
( |
void |
| ) |
|
Get current available subtitles for the video playback.
- Usage example:
Definition luaColor.cpp:6
int new(int r, int g, int b, int a)
Create a new color.
void debugPrint(number x, number y, string text, int color)
Print a text on screen using system font.
string getSubs(void)
Get current available subtitles for the video playback.
- Returns
- Subtitles matching current video playtime from the opened subtitles file.