class AudioAsset implements Asset, HtmlRenderable

Audio asset.

Properties

$duration

Duration in seconds

$mimeType

Methods

__construct(string $url, string|null $file = null, string|null $mimeType = null, float|null $duration = null)

No description

string
__toString()

Allows direct echoing of the object to get the URL.

Html
getImportElement()

Returns HTML tag name and attributes for rendering the asset.

Html
getPreloadElement()

Returns HTML tag name and attributes for preloading the asset.

Details

at line 22
__construct(string $url, string|null $file = null, string|null $mimeType = null, float|null $duration = null)

No description

Parameters

string $url
string|null $file
string|null $mimeType
float|null $duration

at line 35
string __toString()

Allows direct echoing of the object to get the URL.

Return Value

string

at line 41
Html getImportElement()

Returns HTML tag name and attributes for rendering the asset.

Return Value

Html

at line 50
Html getPreloadElement()

Returns HTML tag name and attributes for preloading the asset.

Return Value

Html

Traits

Lazy-loading of properties as a workaround for PHP < 8.4.