embed

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 7, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TagOpen = []byte("<embed")

	AttrSrc    = []byte(" src=\"")
	AttrType   = []byte(" type=\"")
	AttrWidth  = []byte(" width=\"")
	AttrHeight = []byte(" height=\"")
)

Byte constants for HTML rendering.

Functions

func Audio deprecated

func Audio(src string, width int, height int) *element

Audio Creates an embed element for audio content Example: embed.Audio("song.mp3", 320, 50) Renders: <embed src="song.mp3" type="audio/mpeg" width="320" height="50" />

Deprecated: Use the audio element instead.

func Flash deprecated

func Flash(src string, width int, height int) *element

Flash Creates an embed element for Flash content (legacy) Example: embed.Flash("animation.swf", 640, 480) Renders: <embed src="animation.swf" type="application/x-shockwave-flash" width="640" height="480" />

Deprecated: Flash is no longer supported by browsers.

func New

func New() *element

New Creates a new embed element without any initial attributes. Example: embed.New() Renders: <embed />

func PDF

func PDF(src string, width int, height int) *element

PDF Creates an embed element for PDF documents Example: embed.PDF("document.pdf", 800, 600) Renders: <embed src="document.pdf" type="application/pdf" width="800" height="600" />

func Video deprecated

func Video(src string, width int, height int) *element

Video Creates an embed element for video content Example: embed.Video("movie.mp4", 640, 480) Renders: <embed src="movie.mp4" type="video/mp4" width="640" height="480" />

Deprecated: Use the video element instead.

Types

type Element

type Element = element

Element is an exported alias for the private element type

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL