Documentation

AudioMediaInterface extends MediaObjectInterface, MediaPlayerInterface

Class implements audio media interface.

Table of Contents

Methods

__call()  : $this
Allow any action to be called on this medium from twig or markdown
__toString()  : string
Return string representation of the object (html).
addAlternative()  : mixed
Add alternative Medium to this Medium.
addMetaFile()  : mixed
Add meta file for the medium.
attribute()  : $this
Add custom attribute to medium.
autoplay()  : $this
Allows to set the autoplay attribute
classes()  : $this
Add a class to the element from Markdown or Twig Example: ![Example](myimg.png?classes=float-left) or ![Example](myimg.png?classes=myclass1,myclass2)
controls()  : $this
Allows to set or remove the HTML5 default controls
controlsList()  : $this
Allows to set the controlsList behaviour Separate multiple values with a hyphen
copy()  : static
Create a copy of this media object
display()  : MediaObjectInterface|null
Switch display mode.
get()  : mixed
Get value by using dot notation for nested arrays/objects.
getAlternatives()  : array<string|int, mixed>
Get list of image alternatives. Includes the current media image as well.
getMeta()  : array<string|int, mixed>
Returns an array containing the file metadata
id()  : $this
Add an id to the element from Markdown or Twig Example: ![Example](myimg.png?id=primary-img)
lightbox()  : MediaLinkInterface
Turn the current Medium into a Link with lightbox enabled
link()  : MediaLinkInterface
Turn the current Medium into a Link
loop()  : $this
Allows to set the loop attribute
meta()  : Data
Return just metadata from the Medium object
metadata()  : array<string|int, mixed>
Returns an array containing just the metadata
muted()  : $this
Allows to set the muted attribute
parsedownElement()  : array<string|int, mixed>
Get an element (is array) that can be rendered by the Parsedown engine
preload()  : $this
Allows to set the preload behaviour
querystring()  : string
Get/set querystring for the file's url
reset()  : $this
Reset medium.
set()  : $this
Set value by using dot notation for nested arrays/objects.
setTimestamp()  : $this
Set querystring to file modification timestamp (or value provided as a parameter).
style()  : $this
Allows to add an inline style attribute from Markdown or Twig Example: ![Example](myimg.png?style=float:left)
thumbnail()  : $this
Switch thumbnail.
thumbnailExists()  : bool
Helper method to determine if this media item has a thumbnail or not
url()  : string
Return URL to file.
urlHash()  : string
Get/set hash for the file's url
urlQuerystring()  : string
Get the URL with full querystring

Methods

__call()

Allow any action to be called on this medium from twig or markdown

public __call(string $method, mixed $args) : $this
Parameters
$method : string
$args : mixed
Attributes
#[ReturnTypeWillChange]
Return values
$this

__toString()

Return string representation of the object (html).

public __toString() : string
Return values
string

addMetaFile()

Add meta file for the medium.

public addMetaFile(string $filepath) : mixed
Parameters
$filepath : string

attribute()

Add custom attribute to medium.

public attribute([string $attribute = null ][, string $value = '' ]) : $this
Parameters
$attribute : string = null
$value : string = ''
Return values
$this

autoplay()

Allows to set the autoplay attribute

public autoplay([bool $status = false ]) : $this
Parameters
$status : bool = false
Return values
$this

classes()

Add a class to the element from Markdown or Twig Example: ![Example](myimg.png?classes=float-left) or ![Example](myimg.png?classes=myclass1,myclass2)

public classes() : $this
Return values
$this

controls()

Allows to set or remove the HTML5 default controls

public controls([bool $status = true ]) : $this
Parameters
$status : bool = true
Return values
$this

controlsList()

Allows to set the controlsList behaviour Separate multiple values with a hyphen

public controlsList(string $controlsList) : $this
Parameters
$controlsList : string
Return values
$this

get()

Get value by using dot notation for nested arrays/objects.

public get(string $name[, mixed $default = null ][, string|null $separator = null ]) : mixed
Parameters
$name : string

Dot separated path to the requested value.

$default : mixed = null

Default value (or null).

$separator : string|null = null

Separator, defaults to '.'

Tags
example

$value = $this->get('this.is.my.nested.variable');

Return values
mixed

Value.

getAlternatives()

Get list of image alternatives. Includes the current media image as well.

public getAlternatives([bool $withDerived = true ]) : array<string|int, mixed>
Parameters
$withDerived : bool = true

If true, include generated images as well. If false, only return existing files.

Return values
array<string|int, mixed>

getMeta()

Returns an array containing the file metadata

public getMeta() : array<string|int, mixed>
Return values
array<string|int, mixed>

id()

Add an id to the element from Markdown or Twig Example: ![Example](myimg.png?id=primary-img)

public id(string $id) : $this
Parameters
$id : string
Return values
$this

lightbox()

Turn the current Medium into a Link with lightbox enabled

public lightbox([int $width = null ][, int $height = null ][, bool $reset = true ]) : MediaLinkInterface
Parameters
$width : int = null
$height : int = null
$reset : bool = true
Return values
MediaLinkInterface

loop()

Allows to set the loop attribute

public loop([bool $status = false ]) : $this
Parameters
$status : bool = false
Return values
$this

metadata()

Returns an array containing just the metadata

public metadata() : array<string|int, mixed>
Return values
array<string|int, mixed>

muted()

Allows to set the muted attribute

public muted([bool $status = false ]) : $this
Parameters
$status : bool = false
Return values
$this

parsedownElement()

Get an element (is array) that can be rendered by the Parsedown engine

public parsedownElement([string|null $title = null ][, string|null $alt = null ][, string|null $class = null ][, string|null $id = null ][, bool $reset = true ]) : array<string|int, mixed>
Parameters
$title : string|null = null
$alt : string|null = null
$class : string|null = null
$id : string|null = null
$reset : bool = true
Return values
array<string|int, mixed>

preload()

Allows to set the preload behaviour

public preload([string|null $preload = null ]) : $this
Parameters
$preload : string|null = null
Return values
$this

querystring()

Get/set querystring for the file's url

public querystring([string|null $querystring = null ][, bool $withQuestionmark = true ]) : string
Parameters
$querystring : string|null = null
$withQuestionmark : bool = true
Return values
string

set()

Set value by using dot notation for nested arrays/objects.

public set(string $name, mixed $value[, string|null $separator = null ]) : $this
Parameters
$name : string

Dot separated path to the requested value.

$value : mixed

New value.

$separator : string|null = null

Separator, defaults to '.'

Tags
example

$data->set('this.is.my.nested.variable', $value);

Return values
$this

setTimestamp()

Set querystring to file modification timestamp (or value provided as a parameter).

public setTimestamp([string|int|null $timestamp = null ]) : $this
Parameters
$timestamp : string|int|null = null
Return values
$this

style()

Allows to add an inline style attribute from Markdown or Twig Example: ![Example](myimg.png?style=float:left)

public style(string $style) : $this
Parameters
$style : string
Return values
$this

thumbnail()

Switch thumbnail.

public thumbnail([string $type = 'auto' ]) : $this
Parameters
$type : string = 'auto'
Return values
$this

thumbnailExists()

Helper method to determine if this media item has a thumbnail or not

public thumbnailExists([string $type = 'page' ]) : bool
Parameters
$type : string = 'page'

;

Return values
bool

url()

Return URL to file.

public url([bool $reset = true ]) : string
Parameters
$reset : bool = true
Return values
string

urlHash()

Get/set hash for the file's url

public urlHash([string|null $hash = null ][, bool $withHash = true ]) : string
Parameters
$hash : string|null = null
$withHash : bool = true
Return values
string

urlQuerystring()

Get the URL with full querystring

public urlQuerystring(string $url) : string
Parameters
$url : string
Return values
string

        
On this page

Search results