Documentation
¶
Index ¶
- Variables
- func New(nodes ...node.Node) *element
- func PreloadAuto(nodes ...node.Node) *element
- func PreloadMetadata(nodes ...node.Node) *element
- func PreloadNone(nodes ...node.Node) *element
- func RawText(content string) *element
- func RawTextf(format string, args ...any) *element
- func Src(src string, nodes ...node.Node) *element
- func Static(content string) *element
- func Text(content string) *element
- func Textf(format string, args ...any) *element
- type Element
Constants ¶
This section is empty.
Variables ¶
var ( TagOpen = []byte("<video") TagClose = []byte("</video>") AttrSrc = []byte(" src=\"") AttrAutoplay = []byte(" autoplay") AttrControls = []byte(" controls") AttrHeight = []byte(" height=\"") AttrWidth = []byte(" width=\"") AttrLoop = []byte(" loop") AttrMuted = []byte(" muted") AttrPoster = []byte(" poster=\"") AttrPreload = []byte(" preload=\"") AttrLoading = []byte(" loading=\"") AttrCrossOrigin = []byte(" crossorigin=\"") AttrControlsList = []byte(" controlslist=\"") AttrDisablePictureInPicture = []byte(" disablepictureinpicture") AttrDisableRemotePlayback = []byte(" disableremoteplayback") AttrPlaysInline = []byte(" playsinline") )
Byte constants for HTML rendering.
Functions ¶
func New ¶
New Creates a new video element with optional child nodes Example: video.New() Renders: <video></video>
func PreloadAuto ¶
PreloadAuto Creates a video element with preload="auto" (loads entire video) Example: video.PreloadAuto() Renders: <video preload="auto"></video>
func PreloadMetadata ¶
PreloadMetadata Creates a video element with preload="metadata" (loads only metadata) Example: video.PreloadMetadata() Renders: <video preload="metadata"></video>
func PreloadNone ¶
PreloadNone Creates a video element with preload="none" (no preloading) Example: video.PreloadNone() Renders: <video preload="none"></video>
func RawText ¶
func RawText(content string) *element
RawText Creates a new video element with raw fallback text content. Uses text.RawText which is not HTML-escaped. Example: video.RawText("<p>Your browser does not support video.</p>") Renders: <video><p>Your browser does not support video.</p></video>
func RawTextf ¶
RawTextf Creates a new video element with formatted raw fallback text content. Uses text.RawTextf which is not HTML-escaped. Example: video.RawTextf("<p>Cannot play <strong>%s</strong></p>", "movie.mp4") Renders: <video><p>Cannot play <strong>movie.mp4</strong></p></video>
func Src ¶
Src Creates a new video element with src attribute and optional child nodes Example: video.Src("report.pdf") Renders: <video src="report.pdf"></video>
func Static ¶
func Static(content string) *element
Static Creates a new video element with static fallback text content. Uses text.Static which is not HTML-escaped and is JIT-optimisable. Example: video.Static("Video not supported.") Renders: <video>Video not supported.</video>