IVideoPlayer Interface
Interface to control the video player.
Methods
Playback Control
| Method |
Returns |
Description |
PlayMovie() |
void |
Play video |
PauseMovie() |
void |
Toggle pause of video |
PauseNoToggleMovie() |
void |
Pause movie but do not start it if already paused |
UnPauseMovie() |
void |
Resume playing from pause |
StopMovie() |
void |
Stop the video |
PlayFromTimeMS(double seek_to) |
Task |
Start playing from the provided time (async) |
Position & Seeking
| Method |
Returns |
Description |
Seek(double seek_to) |
void |
Seek to a time in the video (seconds from start) |
GetPlayPosition() |
double |
Get the current play position in seconds |
Playback Speed
| Method |
Returns |
Description |
GetPlaybackRate() |
float |
Get current playback speed (1.0 = normal) |
SetPlaybackRate(float speed_factor) |
void |
Set playback speed (1.0 = normal, 2.0 = double speed) |
State Queries
| Method |
Returns |
Description |
IsVideoPlaying() |
bool |
Returns true if video is playing |
IsVideoPaused() |
bool |
Returns true if video is paused |
IsVideoStopped() |
bool |
Returns true if video is stopped |
IsFullscreen() |
bool |
Returns true if video is in fullscreen mode |
| Method |
Returns |
Description |
GetSelectedVideoPath() |
string |
Get path of currently selected video |
GetSelectedVideoID() |
long |
Get catalog ID of currently selected video |
SetSelectedVideo(...) |
void |
Set the selected video in the player |
Example
IVideoPlayer player = scripting.GetVideoPlayer();
// Get current video info
long videoId = player.GetSelectedVideoID();
string path = player.GetSelectedVideoPath();
console.WriteLine($"Playing: {path}");
// Control playback
player.PlayMovie();
player.SetPlaybackRate(1.5f); // 1.5x speed
// Seek to 30 seconds
player.Seek(30.0);
// Get current position
double position = player.GetPlayPosition();
console.WriteLine($"Position: {position} seconds");
// Check state
if (player.IsVideoPlaying())
{
player.PauseMovie();
}
See Also