Search code examples
delphihtml5-videotmstms-web-core

How do I add a video onto my form in a Delphi TMS WEB Core project?


When I search for "image" in the Component Palette, I find many image-related components and I can use the TWebImageControl component to add a images onto my form:

Delphi IDE

But when I search for "video" in the Component Palette, then I get nothing:

Delphi Component Palette

Are there no video-related components?

How can I add a video to my form?


Solution

  • The component for adding a video to a form is the TWebMultimediaPlayer component.

    You can then use the following properties to configure the video:

    • URL: Link to the video file
    • AutoPlay: Boolean to set if the content will start playing as soon as it is ready
    • Loop: Boolean to set if the content is played in a continuous loop
    • Controls: Boolean to set if the playback controls are displayed

    The TWebMultimediaPlayer component will be compiled into a <video> HTML tag.