Skip to content
PHP Ecosystem
Explore

Video

API reference › HTML › Embedded › Video

Renders the HTML <video> element for embedding video content.

Supports the experimental disablepictureinpicture and disableremoteplayback attributes. Availability and behavior may vary across browsers.

See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/video (BaseBlock for the base implementation.).

PropertyTypeDescriptionDefined by
$attributes protectedmixed[]HTML attributes array used by the implementing class. Default: [].UIAwesome\Html\Mixin\HasAttributes
$content protectedstringContent string assigned to the element. Default: ''.UIAwesome\Html\Mixin\HasContent
MethodDescriptionDefined by
__construct() finalInitializes a new tag instance.UIAwesome\Html\Core\Base\BaseTag
__toString()Returns the rendered tag string.UIAwesome\Html\Core\Base\BaseTag
accesskey()Sets the accesskey attribute.UIAwesome\Html\Attribute\Global\HasAccesskey
addAriaAttribute()Sets an aria-* attribute.UIAwesome\Html\Attribute\Global\HasAria
addAttribute()Adds or updates a single HTML attribute for the element.UIAwesome\Html\Mixin\HasAttributes
addDataAttribute()Sets a data-* attribute.UIAwesome\Html\Attribute\Global\HasData
addEvent()Sets an on* event attribute.UIAwesome\Html\Attribute\Global\HasEvents
ariaAttributes()Sets multiple aria-* attributes.UIAwesome\Html\Attribute\Global\HasAria
attributes()Adds or updates multiple HTML attributes for the element.UIAwesome\Html\Mixin\HasAttributes
autofocus()Sets the autofocus attribute.UIAwesome\Html\Attribute\Global\CanBeAutofocus
autoplay()Sets the autoplay attribute.Video
begin() finalStarts begin/end rendering for this instance.UIAwesome\Html\Core\Element\BaseBlock
class()Sets the class attribute.UIAwesome\Html\Attribute\Global\HasClass
clearContent()Clears encoded and raw content without changing other component state.UIAwesome\Html\Mixin\HasContent
config()Applies application-scoped config recipes to this tag.UIAwesome\Html\Core\Base\BaseTag
content()Appends encoded content.UIAwesome\Html\Mixin\HasContent
contentEditable()Sets the contenteditable attribute.UIAwesome\Html\Attribute\Global\HasContentEditable
controls()Sets the controls attribute.Video
controlslist()Sets the controlslist attribute.Video
crossorigin()Sets the crossorigin attribute.UIAwesome\Html\Attribute\HasCrossorigin
dataAttributes()Sets multiple data-* attributes.UIAwesome\Html\Attribute\Global\HasData
dir()Sets the dir attribute.UIAwesome\Html\Attribute\Global\HasDir
disablepictureinpicture()Sets the disablepictureinpicture attribute.Video
disableremoteplayback()Sets the disableremoteplayback attribute.Video
draggable()Sets the draggable attribute.UIAwesome\Html\Attribute\Global\HasDraggable
end() static finalEnds the most recent begin/end rendering block for the current class.UIAwesome\Html\Core\Element\BaseBlock
events()Sets multiple on* event attributes.UIAwesome\Html\Attribute\Global\HasEvents
getAttribute()Returns the value of a single HTML attribute.UIAwesome\Html\Mixin\HasAttributes
getAttributes()Returns the array of HTML attributes for the element.UIAwesome\Html\Mixin\HasAttributes
getContent()Returns the content assigned to the element.UIAwesome\Html\Mixin\HasContent
height()Sets the height attribute.Video
hidden()Sets the hidden attribute.UIAwesome\Html\Attribute\Global\CanBeHidden
html()Appends trusted raw HTML content without encoding or sanitizing it.UIAwesome\Html\Mixin\HasContent
id()Sets the id attribute.UIAwesome\Html\Attribute\Global\HasId
itemId()Sets the itemid attribute.UIAwesome\Html\Attribute\Global\HasMicroData
itemProp()Sets the itemprop attribute.UIAwesome\Html\Attribute\Global\HasMicroData
itemRef()Sets the itemref attribute.UIAwesome\Html\Attribute\Global\HasMicroData
itemScope()Sets the itemscope attribute.UIAwesome\Html\Attribute\Global\HasMicroData
itemType()Sets the itemtype attribute.UIAwesome\Html\Attribute\Global\HasMicroData
lang()Sets the lang attribute.UIAwesome\Html\Attribute\Global\HasLang
loop()Sets the loop attribute.Video
muted()Sets the muted attribute.Video
playsinline()Sets the playsinline attribute.Video
poster()Sets the poster attribute.Video
preload()Sets the preload attribute.Video
removeAriaAttribute()Removes an aria-* attribute.UIAwesome\Html\Attribute\Global\HasAria
removeAttribute()Removes a specific HTML attribute from the element.UIAwesome\Html\Mixin\HasAttributes
removeDataAttribute()Removes a data-* attribute.UIAwesome\Html\Attribute\Global\HasData
removeEvent()Removes an on* event attribute.UIAwesome\Html\Attribute\Global\HasEvents
render() finalRenders the tag with lifecycle hooks.UIAwesome\Html\Core\Base\BaseTag
replaceAttributes()Replaces all HTML attributes for the element.UIAwesome\Html\Mixin\HasAttributes
role()Sets the role attribute.UIAwesome\Html\Attribute\Global\HasRole
spellcheck()Sets the spellcheck attribute.UIAwesome\Html\Attribute\Global\HasSpellcheck
src()Sets the src attribute.Video
style()Sets the style attribute.UIAwesome\Html\Attribute\Global\HasStyle
tabIndex()Sets the tabindex attribute.UIAwesome\Html\Attribute\Global\HasTabindex
tag() staticCreates and configures a new tag instance.UIAwesome\Html\Core\Base\BaseTag
title()Sets the title attribute.UIAwesome\Html\Attribute\Global\HasTitle
translate()Sets the translate attribute.UIAwesome\Html\Attribute\Global\HasTranslate
width()Sets the width attribute.Video
afterRun() protectedPost-processes rendered output.UIAwesome\Html\Core\Event\HasAfterRun
beforeRun() protectedValidates state before rendering.UIAwesome\Html\Core\Event\HasBeforeRun
getTag() protectedReturns the tag enumeration for the <video> element.Video
isBeginExecuted() protectedIndicates whether this instance has an open or closing operation in the current context.UIAwesome\Html\Core\Element\BaseBlock
loadDefault() protectedReturns class-level default definitions.UIAwesome\Html\Core\Base\BaseTag
run() protectedRenders the block element.UIAwesome\Html\Core\Element\BaseBlock
runBegin() protectedReturns the opening tag for begin/end rendering.UIAwesome\Html\Core\Element\BaseBlock
public function autoplay(bool $value): static

Sets the autoplay attribute.

Parameters

ParameterTypeDescription
$valueboolWhether media should automatically begin playback when it can.

Returns

static: New instance with the updated autoplay attribute.

public function controls(bool $value): static

Sets the controls attribute.

Parameters

ParameterTypeDescription
$valueboolWhether browser playback controls should be displayed.

Returns

static: New instance with the updated controls attribute.

public function controlslist(string|UnitEnum|null $value): static

Sets the controlslist attribute.

Parameters

ParameterTypeDescription
$valuestring|UnitEnum|nullControls list token(s), or null to remove the attribute.

Returns

static: New instance with the updated controlslist attribute. Controlslist for predefined enum values.

Throws

public function disablepictureinpicture(bool $value): static

Sets the disablepictureinpicture attribute.

Parameters

ParameterTypeDescription
$valueboolWhether Picture-in-Picture controls and suggestions should be disabled.

Returns

static: New instance with the updated disablepictureinpicture attribute.

public function disableremoteplayback(bool $value): static

Sets the disableremoteplayback attribute.

Parameters

ParameterTypeDescription
$valueboolWhether remote playback should be disabled.

Returns

static: New instance with the updated disableremoteplayback attribute.

public function height(int|string|Stringable|UnitEnum|null $value): static

Sets the height attribute.

Parameters

ParameterTypeDescription
$valueint|string|Stringable|UnitEnum|nullHeight value in pixels or CSS units, or null to remove the attribute.

Returns

static: New instance with the updated height attribute.

public function loop(bool $value): static

Sets the loop attribute.

Parameters

ParameterTypeDescription
$valueboolWhether media should restart automatically when playback reaches the end.

Returns

static: New instance with the updated loop attribute.

public function muted(bool $value): static

Sets the muted attribute.

Parameters

ParameterTypeDescription
$valueboolWhether media output should be initially muted.

Returns

static: New instance with the updated muted attribute.

public function playsinline(bool $value): static

Sets the playsinline attribute.

Parameters

ParameterTypeDescription
$valueboolWhether video playback should stay inline instead of entering fullscreen.

Returns

static: New instance with the updated playsinline attribute.

public function poster(string|UnitEnum|null $value): static

Sets the poster attribute.

Parameters

ParameterTypeDescription
$valuestring|UnitEnum|nullPoster image URL, or null to remove the attribute.

Returns

static: New instance with the updated poster attribute.

public function preload(string|UnitEnum|null $value): static

Sets the preload attribute.

Parameters

ParameterTypeDescription
$valuestring|UnitEnum|nullPreload hint (‘none’, ‘metadata’, or ‘auto’), or null to remove the attribute.

Returns

static: New instance with the updated preload attribute. Preload for predefined enum values.

Throws

public function src(string|Stringable|UnitEnum|null $value): static

Sets the src attribute.

Parameters

ParameterTypeDescription
$valuestring|Stringable|UnitEnum|nullImage source URL or path, or null to remove the attribute.

Returns

static: New instance with the updated src attribute.

public function width(int|string|Stringable|UnitEnum|null $value): static

Sets the width attribute.

Parameters

ParameterTypeDescription
$valueint|string|Stringable|UnitEnum|nullWidth value in pixels or CSS units, or null to remove the attribute.

Returns

static: New instance with the updated width attribute.

protected function getTag(): UIAwesome\Html\Interop\Block

Returns the tag enumeration for the <video> element.

Returns

Block: Tag enumeration instance for <video>. Block for valid block-level tags.