Video()
Creates an HTML5 video element for playing self-hosted video files with optional controls and responsive sizing.
Syntax
Result = MaterialSB::Video(Source.s, Type.s = "video/mp4", Flags = #Media_Default, Parent = #Null)
Parameters
| Source.s | The video file URL or path. |
| Type.s | Optional. MIME type of the video. Default is "video/mp4". |
| Flags | Optional. Combination of media flags for styling and behavior. |
| Parent | Optional. Parent element. If #Null, uses the current parent from the stack. |
Flags
| Flag | Description |
|---|---|
#Media_Default | Standard video element (default) |
#Media_Responsive | Video scales to container width |
#Media_Controls | Show playback controls (play, pause, volume, etc.) |
Return Value
Returns the video element.
Remarks
For YouTube or Vimeo videos, use YoutubeVideo() instead, which creates an iframe embed.
Common video MIME types: "video/mp4", "video/webm", "video/ogg".
Example
Procedure Main(Success)
If Success
MaterialSB::Row(MaterialSB::#Grid_Container)
MaterialSB::Col(12, 8)
MaterialSB::Append(MaterialSB::Header("Video Player", 3))
; Responsive video with controls
MaterialSB::Video("videos/intro.mp4", "video/mp4", MaterialSB::#Media_Responsive | MaterialSB::#Media_Controls)
MaterialSB::CloseCurrentParent()
MaterialSB::Col(12, 4)
MaterialSB::Append(MaterialSB::Header("More Videos", 4))
; WebM video
MaterialSB::Video("videos/demo.webm", "video/webm", MaterialSB::#Media_Responsive | MaterialSB::#Media_Controls)
MaterialSB::CloseCurrentParent()
MaterialSB::CloseCurrentParent()
EndIf
EndProcedure
MaterialSB::Download(@Main())