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()

Returns the asset URL.

Html
getImportElement()

Returns the HTML element used to import the asset (img, script, link rel="stylesheet", etc.).

Html
getPreloadElement()

Returns the HTML element used to preload the asset (link rel="preload" or rel="modulepreload").

Details

at line 20
__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 33
string __toString()

Returns the asset URL.

Return Value

string

at line 39
Html getImportElement()

Returns the HTML element used to import the asset (img, script, link rel="stylesheet", etc.).

Return Value

Html

at line 48
Html getPreloadElement()

Returns the HTML element used to preload the asset (link rel="preload" or rel="modulepreload").

Return Value

Html

Traits

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