Track
API reference › HTML › Embedded › Track
Renders the HTML <track> element for timed text tracks in media.
See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/track (BaseVoid for the base implementation.).
Properties
Section titled “Properties”| Property | Type | Description | Defined by |
|---|---|---|---|
$attributes protected | mixed[] | HTML attributes array used by the implementing class. Default: []. | UIAwesome\ |
Methods
Section titled “Methods”Method details
Section titled “Method details”default()
Section titled “default() ”public function default(bool|null $value): staticSets the default attribute.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | bool| | Default state. Use true to enable, false to disable, or null to remove the attribute. |
Returns
static: New instance with the updated default attribute.
kind()
Section titled “kind() ”public function kind(string|UnitEnum|null $value): staticSets the kind attribute.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | string|UnitEnum| | Track kind (‘subtitles’, ‘captions’, ‘descriptions’, ‘chapters’, or ‘metadata’), or null to remove the attribute. |
Returns
static: New instance with the updated kind attribute. Kind for predefined enum values.
Throws
InvalidArgumentException: if the provided value is not valid.
src()
Section titled “src() ”public function src(string|Stringable|UnitEnum|null $value): staticSets the src attribute.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | string|Stringable|UnitEnum| | Image source URL or path, or null to remove the attribute. |
Returns
static: New instance with the updated src attribute.
srclang()
Section titled “srclang() ”public function srclang(string|UnitEnum|null $value): staticSets the srclang attribute.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | string|UnitEnum| | BCP 47 language tag, or null to remove the attribute. |
Returns
static: New instance with the updated srclang attribute.
getTag()
Section titled “getTag() ”protected function getTag(): UIAwesome\Html\Interop\VoidsReturns the tag enumeration for the <track> element.