Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • typo3/sg_vimeo
1 result
Show changes
Commits on Source (7)
......@@ -53,6 +53,7 @@ class PreviewService {
'thumbnailType' => $this->passVDefOnKeyToTemplate($pluginConfiguration, 'settings.thumbnailType'),
'thumbnailImagesCount' => $this->passVDefOnKeyToTemplate($pluginConfiguration, 'settings.thumbnailImages'),
'showApiResult' => $this->passVDefOnKeyToTemplate($pluginConfiguration, 'settings.showApiResult'),
'urlParameters' => $this->passVDefOnKeyToTemplate($pluginConfiguration, 'settings.urlParameters'),
];
$view->assign('data', $templateData);
......
<?php
namespace SGalinski\SgVimeo\ViewHelpers;
/***************************************************************
* Copyright notice
*
* (c) sgalinski Internet Services (https://www.sgalinski.de)
*
* All rights reserved
*
* This script is part of the AY project. The AY project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
/**
* View helper that takes a URL and adds the parameters respecting the separator
*
* Example:
* {namespace vi=SGalinski\SgVimeo\ViewHelpers}
* <vi:urlWithQueryParameters url="https://player.vimeo.com/video/123?h=xyz" parameters="?origin=https://demo.sgalinski.de" />
* Result: https://player.vimeo.com/video/123?h=xyz&origin=https://demo.sgalinski.de
*/
class UrlWithQueryParametersViewHelper extends AbstractViewHelper {
/**
* Register the ViewHelper arguments
*/
public function initializeArguments(): void {
parent::initializeArguments();
$this->registerArgument('url', 'string', 'The url to add the query parameters to', TRUE);
$this->registerArgument('parameters', 'string', 'The query parameters to add', FALSE, '');
}
/**
* Returns the url with the added query parameters
*
* @return string
*/
public function render(): string {
$url = $this->arguments['url'];
$additionalUrlParameters = $this->arguments['parameters'];
if ($additionalUrlParameters === '') {
return $url;
}
$beginsWithQuestionMark = $additionalUrlParameters[0] === '?';
$beginsWithAmpersand = $additionalUrlParameters[0] === '&';
if ($beginsWithQuestionMark || $beginsWithAmpersand) {
$additionalUrlParameters = substr($additionalUrlParameters, 1);
}
return strpos($url, '?') !== FALSE
? $url . '&' . $additionalUrlParameters
: $url . '?' . $additionalUrlParameters;
}
}
......@@ -195,6 +195,17 @@
</config>
</TCEforms>
</settings.thumbnailImages>
<settings.urlParameters>
<TCEforms>
<exclude>0</exclude>
<label>LLL:EXT:sg_vimeo/Resources/Private/Language/locallang.xlf:flexform.urlParameters</label>
<description>LLL:EXT:sg_vimeo/Resources/Private/Language/locallang.xlf:flexform.urlParameters.description</description>
<config>
<type>input</type>
<eval>trim</eval>
</config>
</TCEforms>
</settings.urlParameters>
<settings.showApiResult>
<TCEforms>
<exclude>0</exclude>
......
......@@ -6,6 +6,8 @@ plugin.tx_sgvimeo {
clientSecret =
# cat=plugin.tx_sgvimeo/file; type=string; label=Vimeo Personal access token
personalAccessToken =
# cat=plugin.tx_sgvimeo/file; type=string; label=Global URL parameters that will be included in the template if the plugin configuration doesn't set its own value.
globalUrlParameters =
}
view {
......
......@@ -3,6 +3,7 @@ plugin.tx_sgvimeo {
clientId = {$plugin.tx_sgvimeo.settings.clientId}
clientSecret = {$plugin.tx_sgvimeo.settings.clientSecret}
personalAccessToken = {$plugin.tx_sgvimeo.settings.personalAccessToken}
globalUrlParameters = {$plugin.tx_sgvimeo.settings.globalUrlParameters}
}
view {
......
......@@ -72,3 +72,8 @@ If the `?disableVimeoCache=1` parameter is added to the URL, this cache will be
### .htaccess
Requires `img-src https://i.vimeocdn.com;`, `script-src https://player.vimeo.com;` and `connect-src https://cdn.plyr.io;`.
### Known issues
- Additional URL parameters won't get passed to the iframe inside the lightbox, this is seemingly caused by Plyr's integration of the Vimeo API
- See also https://github.com/sampotts/plyr/issues/218#issuecomment-849942139
- Workaround: disable the lightbox for your Vimeo video
......@@ -141,6 +141,14 @@
<source><![CDATA[Read less]]></source>
<target><![CDATA[Weniger]]></target>
</trans-unit>
<trans-unit id="flexform.urlParameters" approved="yes">
<source><![CDATA[Additional URL parameters (only without Lightbox)]]></source>
<target><![CDATA[Zusätzliche URL-Parameter (nur ohne Lightbox)]]></target>
</trans-unit>
<trans-unit id="flexform.urlParameters.description" approved="yes">
<source><![CDATA[See https://vimeo.zendesk.com/hc/en-us/articles/360001494447-Player-parameters-overview]]></source>
<target><![CDATA[Siehe https://vimeo.zendesk.com/hc/de/articles/360001494447-Verwendung-von-Player-Parametern]]></target>
</trans-unit>
</body>
</file>
</xliff>
......@@ -104,6 +104,12 @@
<trans-unit id="vimeoPluginTitle">
<source><![CDATA[Vimeo]]></source>
</trans-unit>
<trans-unit id="flexform.urlParameters">
<source><![CDATA[Additional URL parameters (only without Lightbox)]]></source>
</trans-unit>
<trans-unit id="flexform.urlParameters.description">
<source><![CDATA[See https://vimeo.zendesk.com/hc/en-us/articles/360001494447-Player-parameters-overview]]></source>
</trans-unit>
</body>
</file>
</xliff>
......@@ -95,6 +95,15 @@
</td>
</tr>
</f:if>
<tr>
<th scope="row">
<f:translate key="flexform.urlParameters" extensionName="SgVimeo"/>
</th>
<td>
{data.urlParameters}
</td>
</tr>
</tbody>
</table>
</be:link.editRecord>
{namespace sg=SGalinski\ProjectTheme\ViewHelpers}
{namespace vi=SGalinski\SgVimeo\ViewHelpers}
<f:layout name="Default"/>
......@@ -124,10 +125,13 @@
</f:section>
<f:section name="vimeoItem">
<f:variable name="urlParameters">{f:if(condition: '{settings.urlParameters}', then: '{settings.urlParameters}', else: '{settings.globalUrlParameters}')}</f:variable>
<f:variable name="feedItemUrl"><vi:urlWithQueryParameters url="{f:if(condition: '{feedItem.embedLink}', then: '{feedItem.embedLink}', else: '{feedItem.link}')}" parameters="{urlParameters}" /></f:variable>
<div class="sg-video__item">
<a class="sg-video__image-container sg-vimeo-item" href="{f:if(condition: '{feedItem.embedLink}', then: '{feedItem.embedLink}', else: '{feedItem.link}')}" target="_blank"
<a class="sg-video__image-container sg-vimeo-item" href="{feedItemUrl}" target="_blank"
data-disable-lightbox="{settings.disableLightbox}"
data-disable-lightbox-mobile="{settings.disableLightboxMobile}">
data-disable-lightbox-mobile="{settings.disableLightboxMobile}"
data-additional-url-parameters="{urlParameters}">
<f:if condition="{feedItem.thumbnail}">
<f:then>
<img class="sg-video__image" src="{feedItem.thumbnail}" alt="{feedItem.name}" loading="lazy"/>
......
......@@ -4,7 +4,7 @@
"description": "Embed Vimeo Videos of a Playlist or Channel",
"homepage": "https://www.sgalinski.de",
"license": "GPL-2.0-or-later",
"version": "2.2.3",
"version": "2.3.2",
"require": {
"typo3/cms-core": "^10.4.0 || ^11.5.0",
"vimeo/vimeo-api": "^3.0"
......
......@@ -36,7 +36,7 @@ $EM_CONF['sg_vimeo'] = [
'uploadfolder' => '0',
'createDirs' => '',
'clearCacheOnLoad' => 0,
'version' => '2.2.3',
'version' => '2.3.2',
'constraints' => [
'depends' => [
'typo3' => '10.4.0-11.5.99',
......