--- /Users/klodeckl/Desktop/Neuer Ordner/FlowPlayerContentObject (12.08.13 22:08).php 2013-09-16 00:19:27.000000000 +0200 +++ /Users/klodeckl/Desktop/Neuer Ordner/FlowPlayerContentObject.php 2013-09-16 00:18:30.000000000 +0200 @@ -220,18 +220,18 @@ $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) { @@ -360,7 +360,7 @@ 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) @@ -413,25 +413,55 @@ } // 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 . '' . LF; - $divContent = ' -
' . LF . '' . LF; + $flashDivContent = $videoFlashParams . LF . '' . LF; + /*$divContent = ' +
' . LF . '' . LF;*/ $content = str_replace('###SWFOBJECT###', '
' . LF . $divContent . '
', $content); } else { // Video tag with Flash fallback $conf['params.']['playerFallbackOrder'] = array('html5', 'flash'); $videoTagContent = $videoSources . $videoCaptions; if (isset($conf['videoflashvars']['url'])) { - $videoTagContent .= ' - '; + /*$videoTagContent .= ' + ';*/ } $divContent = ' -
' . LF . ''; +
' . LF . ''; $content = str_replace('###SWFOBJECT###', '
' . LF . $divContent . '
', $content); } } @@ -705,9 +735,34 @@ // 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.']); }