diff --git a/Classes/ViewHelpers/Media/AbstractMediaViewHelper.php b/Classes/ViewHelpers/Media/AbstractMediaViewHelper.php index 986eddd9e..390bac770 100755 --- a/Classes/ViewHelpers/Media/AbstractMediaViewHelper.php +++ b/Classes/ViewHelpers/Media/AbstractMediaViewHelper.php @@ -58,11 +58,17 @@ public function initializeArguments() */ public static function preprocessSourceUri($src, array $arguments) { - $src = $GLOBALS['TSFE']->absRefPrefix . str_replace('%2F', '/', rawurlencode($src)); - if (false === empty($GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_vhs.']['settings.']['prependPath'])) { - $src = $GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_vhs.']['settings.']['prependPath'] . $src; - } elseif ('BE' === TYPO3_MODE || false === (boolean) $arguments['relative']) { - $src = GeneralUtility::getIndpEnv('TYPO3_SITE_URL') . ltrim($src, '/'); + $parsedSrc = parse_url($src); + if (isset($parsedSrc['host'])) { + $scheme = isset($parsedSrc['scheme']) ? $parsedSrc['scheme'] : (GeneralUtility::getIndpEnv('TYPO3_SSL') ? 'https' : 'http'); + $src = $scheme . '://' . $parsedSrc['host'] . str_replace('%2F', '/', rawurlencode($parsedSrc['path'])); + } else { + $src = $GLOBALS['TSFE']->absRefPrefix . str_replace('%2F', '/', rawurlencode($src)); + if (false === empty($GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_vhs.']['settings.']['prependPath'])) { + $src = $GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_vhs.']['settings.']['prependPath'] . $src; + } elseif ('BE' === TYPO3_MODE || false === (boolean) $arguments['relative']) { + $src = GeneralUtility::getIndpEnv('TYPO3_SITE_URL') . ltrim($src, '/'); + } } return $src; }