CreateYoutubeUriViewHelper 

The ViewHelper e2:createYoutubeUri searches the given link for the YouTube ID and returns the embedded YouTube link of this ID.

Link: https://www.youtube.com/watch?v=B5gDI2h0F20

YouTube ID: B5gDI2h0F20

Embedded link: //www.youtube.com/embed/B5gDI2h0F20

Changed in version 12.0.0

The argument link is optional. If it is not set, the tag content is used, so the ViewHelper can be used in inline syntax.

Arguments of the CreateYoutubeUriViewHelper 

link
The YouTube link or the YouTube ID. If not set, the tag content is used.

Example for the CreateYoutubeUriViewHelper 

EXT:my_sitepackage/Resources/Private/Templates/Video/Show.html (excerpt)
{namespace e2=JWeiland\Events2\ViewHelpers}

<iframe width="560"
        height="315"
        src="{e2:createYoutubeUri(link: event.videoLink.link)}"
        allowfullscreen></iframe>

<!-- Inline syntax -->
<iframe width="560"
        height="315"
        src="{event.videoLink.link -> e2:createYoutubeUri()}"
        allowfullscreen></iframe>
Copied!