Download Now

    Reference TVideoWidget

    Declared in Codebot.Render.Widgets.Video.pas on line 81

    TVideoWidget plays a video, as described above
      TVideoWidget = class(TCustomWidget)
      protected
        procedure Paint(Stage: TPaintStage); override;
      public
        constructor Create(Parent: TWidget; const Name: string = ''); override;
        destructor Destroy; override;
        { Play the video, or continue it if it is paused }
        procedure Play;
        { Hold the video where it is }
        procedure Pause;
        { Unload the video }
        procedure Stop;
        { The file or url of the video. Changing it while a video is playing plays
          the new video. }
        property FileName: string read FFileName write SetFileName;
        { Where the video is in seconds }
        property Position: Double read GetPosition write SetPosition;
        { How long the video is in seconds, or zero if it is not known }
        property Duration: Double read GetDuration;
        { Whether the video is stopped, playing, or paused }
        property State: TVideoState read FState;
        { When true the video plays again from the beginning when it ends }
        property AutoRestart: Boolean read FAutoRestart write FAutoRestart;
        { True if the video has sound. It is false until the video has been loaded,
          which is shortly after Play. }
        property HasAudio: Boolean read GetHasAudio;
        { How loud the sound of the video is, from 0 for silent to 1 for its normal
          loudness, which is the default }
        property Volume: Float read FVolume write SetVolume;
        { When true the sound of the video is silenced, leaving Volume as it is }
        property Muted: Boolean read FMuted write SetMuted;
        { The source of a fragment shader which draws the video, or empty for no
          effect }
        property Effect: string read FEffect write SetEffect;
        { What the compiler said if Effect did not compile, or empty }
        property EffectError: string read FEffectError;
        { False if the player could not be made }
        property Available: Boolean read GetAvailable;
        { OnPlayComplete fires when the video reaches its end }
        property OnPlayComplete: TNotifyEvent read FOnPlayComplete write FOnPlayComplete;
      end;

    See also

    Float in Codebot.System.pas
    TCustomWidget in Codebot.Render.Widgets.pas
    TPaintStage in Codebot.Render.Widgets.pas
    TWidget in Codebot.Render.Widgets.pas