AudioAsset
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
at line 33
string
__toString()
Returns the asset URL.
at line 39
Html
getImportElement()
Returns the HTML element used to import the asset (img, script, link rel="stylesheet", etc.).
at line 48
Html
getPreloadElement()
Returns the HTML element used to preload the asset (link rel="preload" or rel="modulepreload").
Traits
Lazy-loading of properties as a workaround for PHP < 8.4.