MediaPlayerInterface
extends
MediaObjectInterface
in
Class implements media player 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:  or 
- controls() : $this
- Allows to set or remove the HTML5 default controls
- 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: 
- 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: 
- 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
stringaddAlternative()
Add alternative Medium to this Medium.
public
addAlternative(int|float $ratio, MediaObjectInterface $alternative) : mixed
Parameters
- $ratio : int|float
- $alternative : MediaObjectInterface
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
$thisautoplay()
Allows to set the autoplay attribute
public
autoplay([bool $status = false ]) : $this
Parameters
- $status : bool = false
Return values
$thisclasses()
Add a class to the element from Markdown or Twig Example:  or 
public
classes() : $this
Return values
$thiscontrols()
Allows to set or remove the HTML5 default controls
public
controls([bool $status = true ]) : $this
Parameters
- $status : bool = true
Return values
$thiscopy()
Create a copy of this media object
public
copy() : static
Return values
staticdisplay()
Switch display mode.
public
display([string $mode = 'source' ]) : MediaObjectInterface|null
Parameters
- $mode : string = 'source'
Return values
MediaObjectInterface|nullget()
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
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: 
public
id(string $id) : $this
Parameters
- $id : string
Return values
$thislightbox()
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
MediaLinkInterfacelink()
Turn the current Medium into a Link
public
link([bool $reset = true ][, array<string|int, mixed> $attributes = [] ]) : MediaLinkInterface
Parameters
- $reset : bool = true
- $attributes : array<string|int, mixed> = []
Return values
MediaLinkInterfaceloop()
Allows to set the loop attribute
public
loop([bool $status = false ]) : $this
Parameters
- $status : bool = false
Return values
$thismeta()
Return just metadata from the Medium object
public
meta() : Data
Return values
Datametadata()
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
$thisparsedownElement()
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
$thisquerystring()
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
stringreset()
Reset medium.
public
reset() : $this
Return values
$thisset()
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
Return values
$thissetTimestamp()
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
$thisstyle()
Allows to add an inline style attribute from Markdown or Twig Example: 
public
style(string $style) : $this
Parameters
- $style : string
Return values
$thisthumbnail()
Switch thumbnail.
public
thumbnail([string $type = 'auto' ]) : $this
Parameters
- $type : string = 'auto'
Return values
$thisthumbnailExists()
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
boolurl()
Return URL to file.
public
url([bool $reset = true ]) : string
Parameters
- $reset : bool = true
Return values
stringurlHash()
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
stringurlQuerystring()
Get the URL with full querystring
public
urlQuerystring(string $url) : string
Parameters
- $url : string