TVideo
Source: source/classes/video.prg
Inherits from: TControl
TVideo is a media playback control that uses the Windows MCI (Media Control Interface) to play video files. It supports AVI and other MCI-compatible video formats. The control displays the video in a rectangular area within a FiveWin window or dialog, with optional borderless rendering.
Key DATA Members
| DATA | Type | Description |
|---|---|---|
oMci | Object | Internal MCI device object managing playback |
cAviFile | Character | Path to the AVI (or other video) file |
cType | Character | MCI device type string (e.g., "AVIVideo") |
Methods
| Method | Description |
|---|---|
New( nRow, nCol, nW, nH, cFile, oWnd, lNoBorder, cType ) | Create a new video playback control |
Play( nFrom, nTo ) | Play the video from frame nFrom to nTo. If omitted, play the entire video. |
PlayFull() | Play the video in full-screen mode |
Position() | Return the current playback position in frames |
Length() | Return the total number of frames in the video |
End() | Stop playback and close the MCI device |
Example: Play AVI File
#include "FiveWin.ch"
function Main()
local oWnd, oVideo
DEFINE WINDOW oWnd TITLE "Video Player" SIZE 640, 520
@ 10, 10 VIDEO oVideo FILE "sample.avi" ;
SIZE 600, 450 OF oWnd
oVideo:Play()
ACTIVATE WINDOW oWnd CENTERED
return nil
Notes
- TVideo wraps the Windows MCI API (
mciSendString) for video playback. Ensure the appropriate MCI drivers are installed on the target system. - Use the
lNoBorderparameter inNew()to remove the border around the video display area. - The
cTypeparameter specifies the MCI device type. The default is"AVIVideo"for AVI files. - Call
End()when the video is no longer needed to release the MCI device resources.