‪TYPO3CMS  10.4
TYPO3\CMS\Core\Resource\Rendering\YouTubeRenderer Class Reference
Inheritance diagram for TYPO3\CMS\Core\Resource\Rendering\YouTubeRenderer:
TYPO3\CMS\Core\Resource\Rendering\FileRendererInterface TYPO3\CMS\Core\SingletonInterface

Public Member Functions

int getPriority ()
 
bool canRender (FileInterface $file)
 
string render (FileInterface $file, $width, $height, array $options=[], $usedPathsRelativeToCurrentScript=false)
 

Protected Member Functions

bool OnlineMediaHelperInterface getOnlineMediaHelper (FileInterface $file)
 
array collectOptions (array $options, FileInterface $file)
 
string createYouTubeUrl (array $options, FileInterface $file)
 
string getVideoIdFromFile (FileInterface $file)
 
array collectIframeAttributes ($width, $height, array $options)
 
string implodeAttributes (array $attributes)
 

Protected Attributes

OnlineMediaHelperInterface $onlineMediaHelper
 

Detailed Description

YouTube renderer class

Definition at line 28 of file YouTubeRenderer.php.

Member Function Documentation

◆ canRender()

bool TYPO3\CMS\Core\Resource\Rendering\YouTubeRenderer::canRender ( FileInterface  $file)

◆ collectIframeAttributes()

array TYPO3\CMS\Core\Resource\Rendering\YouTubeRenderer::collectIframeAttributes (   $width,
  $height,
array  $options 
)
protected
Parameters
int | string$width
int | string$height
array$options
Returns
‪array pairs of key/value; not yet html-escaped

Definition at line 191 of file YouTubeRenderer.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Core\Resource\Rendering\YouTubeRenderer\render().

◆ collectOptions()

array TYPO3\CMS\Core\Resource\Rendering\YouTubeRenderer::collectOptions ( array  $options,
FileInterface  $file 
)
protected
Parameters
array$options
FileInterface$file
Returns
‪array

Definition at line 109 of file YouTubeRenderer.php.

References TYPO3\CMS\Core\Resource\FileInterface\getProperty().

Referenced by TYPO3\CMS\Core\Resource\Rendering\YouTubeRenderer\render().

◆ createYouTubeUrl()

string TYPO3\CMS\Core\Resource\Rendering\YouTubeRenderer::createYouTubeUrl ( array  $options,
FileInterface  $file 
)
protected

◆ getOnlineMediaHelper()

◆ getPriority()

int TYPO3\CMS\Core\Resource\Rendering\YouTubeRenderer::getPriority ( )

Returns the priority of the renderer This way it is possible to define/overrule a renderer for a specific file type/context. For example create a video renderer for a certain storage/driver type. Should be between 1 and 100, 100 is more important than 1

Returns
‪int

Implements TYPO3\CMS\Core\Resource\Rendering\FileRendererInterface.

Definition at line 43 of file YouTubeRenderer.php.

◆ getVideoIdFromFile()

string TYPO3\CMS\Core\Resource\Rendering\YouTubeRenderer::getVideoIdFromFile ( FileInterface  $file)
protected

◆ implodeAttributes()

string TYPO3\CMS\Core\Resource\Rendering\YouTubeRenderer::implodeAttributes ( array  $attributes)
protected
Parameters
array$attributes
Returns
‪string

Definition at line 227 of file YouTubeRenderer.php.

Referenced by TYPO3\CMS\Core\Resource\Rendering\YouTubeRenderer\render().

◆ render()

string TYPO3\CMS\Core\Resource\Rendering\YouTubeRenderer::render ( FileInterface  $file,
  $width,
  $height,
array  $options = [],
  $usedPathsRelativeToCurrentScript = false 
)

Render for given File(Reference) html output

Parameters
FileInterface$file
int | string$widthTYPO3 known format; examples: 220, 200m or 200c
int | string$heightTYPO3 known format; examples: 220, 200m or 200c
array$options
bool$usedPathsRelativeToCurrentScript‪See $file->getPublicUrl()
Returns
‪string

Implements TYPO3\CMS\Core\Resource\Rendering\FileRendererInterface.

Definition at line 91 of file YouTubeRenderer.php.

References TYPO3\CMS\Core\Resource\Rendering\YouTubeRenderer\collectIframeAttributes(), TYPO3\CMS\Core\Resource\Rendering\YouTubeRenderer\collectOptions(), TYPO3\CMS\Core\Resource\Rendering\YouTubeRenderer\createYouTubeUrl(), and TYPO3\CMS\Core\Resource\Rendering\YouTubeRenderer\implodeAttributes().

Referenced by TYPO3\CMS\Core\Tests\Unit\Resource\Rendering\YouTubeRendererTest\renderOutputIsEscaped().

Member Data Documentation

◆ $onlineMediaHelper

OnlineMediaHelperInterface TYPO3\CMS\Core\Resource\Rendering\YouTubeRenderer::$onlineMediaHelper
protected