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

DATATypeDescription
oMciObjectInternal MCI device object managing playback
cAviFileCharacterPath to the AVI (or other video) file
cTypeCharacterMCI device type string (e.g., "AVIVideo")

Methods

MethodDescription
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

See Also