Issue Bug Closed

#94357VimeoRenderer generates wrong urls for vimeo events.

Kai Strecker 06/16/21, 13:27 updated 09/07/21, 07:33

Description

Steps to reproduce:

  1. Create a “Text and media” content element.
  2. Add media by url. Use a vimeo event url in the format https://vimeo.com/event/1234567.
  3. Save the element.
  4. Render the file reference using the <f:media> view helper (should be the default, when using fluid_styled_content).</f:media>

Result: The <f:media> view helper uses TYPO3\CMS\Core\Resource\Rendering\VimeoRenderer to render an iframe, but the method createVimeoUrl generates a wrong url. The url is <a href="https://player.vimeo.com/video/event/1234567" target="_blank" rel="noreferrer">https://player.vimeo.com/video/event/1234567</a>, but it should be <a href="https://vimeo.com/1234567/embed" target="_blank" rel="noreferrer">https://vimeo.com/1234567/embed</a> instead. The reason for that is, that the variable videoId contains “1234567” for a normal video, but “event/1234567” for an event. So, this can be fixed easily:</f:media>

Replace

return sprintf('https://player.vimeo.com/video/%s?%s', $videoId, implode('&', $urlParams));

with

if (strpos($videoId, 'event/') !== false) {
    return sprintf('https://vimeo.com/%s/embed?%s', $videoId, implode('&', $urlParams));
} else {
    return sprintf('https://player.vimeo.com/video/%s?%s', $videoId, implode('&', $urlParams));
}

Thanks in advance for fixing!

Reviews 2