Project

General

Profile

Bug #51042 » class.tslib_content_flowplayer.patch

Bernhard Eckl, 2013-09-09 14:34

View differences:

/Users/ec/Desktop/Neuer Ordner 3/class.tslib_content_flowplayer.php 2013-09-09 14:16:59.000000000 +0200
$typeConf = $conf[$type . '.'];
// Add Flowplayer js-file
$GLOBALS['TSFE']->getPageRenderer()->addJsFile(TYPO3_mainDir . 'contrib/flowplayer/example/flowplayer-3.2.6.min.js');
//$GLOBALS['TSFE']->getPageRenderer()->addJsFile(TYPO3_mainDir . 'contrib/flowplayer/example/flowplayer-3.2.6.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');
// Add videoJS js-file
......
// 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($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 .
'<video '.$poster.'id="' . $replaceElementIdString . '_video_js" class="video-js vjs-default-skin" ' . $attributes . 'controls="controls" 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 .
<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;
'</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 .= '
/*$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>';
'</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 .
'<video '.$poster.'id="' . $replaceElementIdString . '_video_js" class="video-js vjs-default-skin" ' . $attributes . 'controls="controls" 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);
......
$videoSourcesEmbedding .
$flowplayerHandlers;
if ($jsInlineCode) {
$jsInlineCode = 'VideoJS.DOMReady(function(){' .
/*$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.']);
(1-1/5)