Bug #51042 » FlowPlayerContentObject.patch
/Users/klodeckl/Desktop/Neuer Ordner/FlowPlayerContentObject.php 2013-09-16 00:18:30.000000000 +0200 | ||
---|---|---|
$type = isset($conf['type.']) ? $this->cObj->stdWrap($conf['type'], $conf['type.']) : $conf['type'];
|
||
$typeConf = $conf[$type . '.'];
|
||
// Add Flowplayer js-file
|
||
$GLOBALS['TSFE']->getPageRenderer()->addJsFile(TYPO3_mainDir . 'contrib/flowplayer/flowplayer-3.2.12.min.js');
|
||
//$GLOBALS['TSFE']->getPageRenderer()->addJsFile(TYPO3_mainDir . 'contrib/flowplayer/flowplayer-3.2.12.min.js');
|
||
// Add Flowpayer css for exprss install
|
||
$GLOBALS['TSFE']->getPageRenderer()->addCssFile(TYPO3_mainDir . '../t3lib/js/flowplayer/express-install.css');
|
||
//$GLOBALS['TSFE']->getPageRenderer()->addCssFile(TYPO3_mainDir . '../t3lib/js/flowplayer/express-install.css');
|
||
// Add videoJS js-file
|
||
$GLOBALS['TSFE']->getPageRenderer()->addJsFile(TYPO3_mainDir . 'contrib/videojs/video-js/video.js');
|
||
//$GLOBALS['TSFE']->getPageRenderer()->addJsFile(TYPO3_mainDir . 'contrib/videojs/video-js/video.js');
|
||
// Add videoJS js-file
|
||
$GLOBALS['TSFE']->getPageRenderer()->addJsFile(TYPO3_mainDir . 'contrib/videojs/video-js/video.js');
|
||
// Add videoJS css-file
|
||
$GLOBALS['TSFE']->getPageRenderer()->addCssFile(TYPO3_mainDir . 'contrib/videojs/video-js/video-js.css');
|
||
// Add extended videoJS control bar
|
||
$GLOBALS['TSFE']->getPageRenderer()->addJsFile(TYPO3_mainDir . '../t3lib/js/videojs/control-bar.js');
|
||
$GLOBALS['TSFE']->getPageRenderer()->addCssFile(TYPO3_mainDir . '../t3lib/js/videojs/control-bar.css');
|
||
//$GLOBALS['TSFE']->getPageRenderer()->addJsFile(TYPO3_mainDir . '../t3lib/js/videojs/control-bar.js');
|
||
//$GLOBALS['TSFE']->getPageRenderer()->addCssFile(TYPO3_mainDir . '../t3lib/js/videojs/control-bar.css');
|
||
// Build Flash configuration
|
||
$player = isset($typeConf['player.']) ? $this->cObj->stdWrap($typeConf['player'], $typeConf['player.']) : $typeConf['player'];
|
||
if (!$player) {
|
||
... | ... | |
if ($conf['type'] == 'video') {
|
||
if (is_array($conf['audioSources']) && count($conf['audioSources'])) {
|
||
// Add videoJS audio description toggle
|
||
$GLOBALS['TSFE']->getPageRenderer()->addJsFile(TYPO3_mainDir . '../t3lib/js/videojs/audio-description.js');
|
||
//$GLOBALS['TSFE']->getPageRenderer()->addJsFile(TYPO3_mainDir . '../t3lib/js/videojs/audio-description.js');
|
||
}
|
||
if (isset($conf['audioFallback'])) {
|
||
// Audio description flowplayer config (remove controls)
|
||
... | ... | |
}
|
||
// Alternate content
|
||
$alternativeContent = isset($conf['alternativeContent.']) ? $this->cObj->stdWrap($conf['alternativeContent'], $conf['alternativeContent.']) : $conf['alternativeContent'];
|
||
if (file_exists(substr(parse_url($filename, PHP_URL_PATH), 1, -3).'jpg')) {
|
||
$poster = 'poster="'.substr($filename, 0, -3).'jpg" ';
|
||
}
|
||
else {
|
||
if (is_array($conf['sources'])) {
|
||
$i = 0;
|
||
foreach ($conf['sources'] as $source) {
|
||
$sourceposter[$i] = $source;
|
||
$i++;
|
||
}
|
||
$ii = 0;
|
||
while ($ii <= $i):
|
||
if (file_exists(substr(parse_url($sourceposter[$ii], PHP_URL_PATH), 1, -3).'jpg')) {
|
||
$poster = 'poster="'.substr($sourceposter[$ii], 0, -3).'jpg" ';
|
||
}
|
||
else {
|
||
if (!isset($poster)) {
|
||
$poster = '';
|
||
}
|
||
}
|
||
$ii++;
|
||
endwhile;
|
||
}
|
||
else {
|
||
$poster = '';
|
||
}
|
||
}
|
||
// Render video
|
||
if ($conf['type'] === 'video') {
|
||
if ($conf['preferFlashOverHtml5']) {
|
||
// Flash with video tag fallback
|
||
$conf['params.']['playerFallbackOrder'] = array('flash', 'html5');
|
||
$flashDivContent = $videoFlashParams . LF . '<video id="' . $replaceElementIdString . '_video_js" class="video-js" ' . $attributes . 'controls="controls" mediagroup="' . $replaceElementIdString . '" width="' . $width . '" height="' . $height . '">' . LF . $videoSources . $videoCaptions . $alternativeContent . LF . '</video>' . LF;
|
||
$divContent = '
|
||
<div id="' . $replaceElementIdString . '_flash_install_info" class="flash-install-info"></div>' . LF . '<noscript>' . LF . '<object id="' . $replaceElementIdString . '_vjs_flash" type="application/x-shockwave-flash" data="' . $player . '" width="' . $width . '" height="' . $height . '">' . LF . $flashDivContent . '</object>' . LF . '</noscript>' . LF;
|
||
$flashDivContent = $videoFlashParams . LF . '<video '.$poster.' id="' . $replaceElementIdString . '_video_js" class="video-js vjs-default-skin" ' . $attributes . 'controls="controls" mediagroup="' . $replaceElementIdString . '" width="' . $width . '" height="' . $height . '" data-setup="{}">' . LF . $videoSources . $videoCaptions . $alternativeContent . LF . '</video>' . LF;
|
||
/*$divContent = '
|
||
<div id="' . $replaceElementIdString . '_flash_install_info" class="flash-install-info"></div>' . LF . '<noscript>' . LF . '<object id="' . $replaceElementIdString . '_vjs_flash" type="application/x-shockwave-flash" data="' . $player . '" width="' . $width . '" height="' . $height . '">' . LF . $flashDivContent . '</object>' . LF . '</noscript>' . LF;*/
|
||
$content = str_replace('###SWFOBJECT###', '<div id="' . $replaceElementIdString . '_video" class="flashcontainer" style="width:' . $width . 'px; height:' . $height . 'px;">' . LF . $divContent . '</div>', $content);
|
||
} else {
|
||
// Video tag with Flash fallback
|
||
$conf['params.']['playerFallbackOrder'] = array('html5', 'flash');
|
||
$videoTagContent = $videoSources . $videoCaptions;
|
||
if (isset($conf['videoflashvars']['url'])) {
|
||
$videoTagContent .= '
|
||
<noscript>' . LF . '<object class="vjs-flash-fallback" id="' . $replaceElementIdString . '_vjs_flash_fallback" type="application/x-shockwave-flash" data="' . $player . '" width="' . $width . '" height="' . $height . '">' . LF . $videoFlashParams . LF . $alternativeContent . LF . '</object>' . LF . '</noscript>';
|
||
/*$videoTagContent .= '
|
||
<noscript>' . LF . '<object class="vjs-flash-fallback" id="' . $replaceElementIdString . '_vjs_flash_fallback" type="application/x-shockwave-flash" data="' . $player . '" width="' . $width . '" height="' . $height . '">' . LF . $videoFlashParams . LF . $alternativeContent . LF . '</object>' . LF . '</noscript>';*/
|
||
}
|
||
$divContent = '
|
||
<div id="' . $replaceElementIdString . '_flash_install_info" class="flash-install-info"></div>' . LF . '<video id="' . $replaceElementIdString . '_video_js" class="video-js" ' . $attributes . 'controls="controls" mediagroup="' . $replaceElementIdString . '" width="' . $width . '" height="' . $height . '">' . LF . $videoTagContent . '</video>';
|
||
<div id="' . $replaceElementIdString . '_flash_install_info" class="flash-install-info"></div>' . LF . '<video '.$poster.' id="' . $replaceElementIdString . '_video_js" class="video-js vjs-default-skin" ' . $attributes . 'controls="controls" mediagroup="' . $replaceElementIdString . '" width="' . $width . '" height="' . $height . '" data-setup="{}">' . LF . $videoTagContent . '</video>';
|
||
$content = str_replace('###SWFOBJECT###', '<div id="' . $replaceElementIdString . '_video" class="video-js-box" style="width:' . $width . 'px; height:' . $height . 'px;">' . LF . $divContent . '</div>', $content);
|
||
}
|
||
}
|
||
... | ... | |
// Wrap up inline JS code
|
||
$jsInlineCode = $audioSourcesEmbedding . $videoSourcesEmbedding . $flowplayerHandlers;
|
||
if ($jsInlineCode) {
|
||
$jsInlineCode = 'VideoJS.DOMReady(function(){' . $jsInlineCode . LF . '});';
|
||
//$jsInlineCode = 'VideoJS.DOMReady(function(){' . $jsInlineCode . LF . '});';
|
||
}
|
||
if ($conf['type'] === 'video') {
|
||
$GLOBALS['TSFE']->getPageRenderer()->addJsInlineCode($replaceElementIdString, $jsInlineCode);
|
||
}
|
||
else {
|
||
$GLOBALS['TSFE']->getPageRenderer()->addJsFooterFile('fileadmin/player/mediaelement/mediaelement-and-player.min.js',
|
||
$type = 'text/javascript',
|
||
$compress = TRUE,
|
||
$forceOnTop = FALSE,
|
||
$allWrap = '',
|
||
$excludeFromConcatenation = FALSE
|
||
);
|
||
$GLOBALS['TSFE']->getPageRenderer()->addCssFile ('fileadmin/player/mediaelement/mediaelementplayer.css',
|
||
$rel = 'stylesheet',
|
||
$media = 'all',
|
||
$title = '',
|
||
$compress = TRUE,
|
||
$forceOnTop = FALSE,
|
||
$allWrap = '',
|
||
$excludeFromConcatenation = FALSE
|
||
);
|
||
$GLOBALS['TSFE']->getPageRenderer()->addJsInlineCode("mediaelement","
|
||
jQuery(document).ready(function(){
|
||
$('audio').mediaelementplayer();
|
||
});
|
||
");
|
||
}
|
||
if (isset($conf['stdWrap.'])) {
|
||
$content = $this->cObj->stdWrap($content, $conf['stdWrap.']);
|
||
}
|
- « Previous
- 1
- …
- 3
- 4
- 5
- Next »