[BUGFIX] Media Element does not play videos with own player anymore
authorSteffen Ritter <info@rs-websystems.de>
Wed, 11 Apr 2012 15:11:24 +0000 (17:11 +0200)
committerSteffen Ritter <info@rs-websystems.de>
Wed, 11 Apr 2012 18:28:02 +0000 (20:28 +0200)
Since the rewrite to FlowPlayer and the additions for accessibility
the MEDIA Content Element is not capable anymore, to play videos which
ship their own player.

This especially is the case for Videos which are from YouTube, Vimeo
and other similiar platforms. Looking at the implementation it seems,
that the detection of own players has been removed (accidentilly).

Rebuild this detection to make external video platform links work again.

Change-Id: I963a74aa3e1ab6d2de95ade903470be71af5c2d4
Fixes: #33357
Releases: 6.0, 4.7
Reviewed-on: http://review.typo3.org/10259
Reviewed-by: Susanne Moog
Tested-by: Susanne Moog
Reviewed-by: Steffen Ritter
Tested-by: Steffen Ritter
typo3/sysext/cms/tslib/content/class.tslib_content_media.php
typo3/sysext/css_styled_content/static/constants.txt
typo3/sysext/css_styled_content/static/setup.txt

index 5b2fefc..0959135 100644 (file)
@@ -185,16 +185,39 @@ class tslib_content_Media extends tslib_content_Abstract {
                        }
                }
 
-               switch ($renderType) {
-                       case 'swf' :
-                               $conf[$conf['type'] . '.'] = array_merge((array) $conf['mimeConf.']['swfobject.'][$conf['type'] . '.'], $typeConf);
+               if ($renderType !== 'qt' && $renderType !== 'embed') {
+                       if (isset($conf['file']) && (
+                                       strpos($conf['file'], '.swf') !== FALSE ||
+                                       (strpos($conf['file'], '://') !== FALSE) && strpos(t3lib_div::getUrl($conf['file'], 2), 'application/x-shockwave-flash') !== false)
+                       ) {
                                $conf = array_merge((array) $conf['mimeConf.']['swfobject.'], $conf);
+                               $conf[$conf['type'] . '.']['player'] = strpos($conf['file'], '://') === FALSE ? 'http://' . $conf['file'] : $conf['file'];
+                               $conf['installUrl'] = 'null';
+                               $conf['forcePlayer'] = 0;
+                               $renderType = 'swf';
+                       } elseif (isset($conf['file']) && !isset($conf['caption']) && !isset($conf['sources'])) {
+                               $renderType = 'swf';
+                               $conf['forcePlayer'] = 1;
+                       }
+               }
+
+               switch ($renderType) {
+                       case 'flowplayer':
+                               $conf[$conf['type'] . '.'] = array_merge((array) $conf['mimeConf.']['flowplayer.'][$conf['type'] . '.'], $typeConf);
+                               $conf = array_merge((array) $conf['mimeConf.']['flowplayer.'], $conf);
                                unset($conf['mimeConf.']);
                                $conf['attributes.'] = array_merge((array) $conf['attributes.'], $conf['predefined']);
                                $conf['params.'] = array_merge((array) $conf['params.'], $conf['predefined']);
                                $conf['flashvars.'] = array_merge((array) $conf['flashvars.'], $conf['predefined']);
                                $content = $this->cObj->FLOWPLAYER($conf);
                        break;
+                       case 'swf':
+                               $conf[$conf['type'] . '.'] = array_merge((array) $conf['mimeConf.']['swfobject.'][$conf['type'] . '.'], $typeConf);
+                               $conf = array_merge((array) $conf['mimeConf.']['swfobject.'], $conf);
+                               unset($conf['mimeConf.']);
+                               $conf['flashvars.'] = array_merge((array) $conf['flashvars.'], $conf['predefined']);
+                               $content = $this->cObj->SWFOBJECT($conf);
+                       break;
                        case 'qt' :
                                $conf[$conf['type'] . '.'] = array_merge($conf['mimeConf.']['swfobject.'][$conf['type'] . '.'], $typeConf);
                                $conf = array_merge($conf['mimeConf.']['qtobject.'], $conf);
@@ -225,7 +248,6 @@ class tslib_content_Media extends tslib_content_Abstract {
                                        $content = $this->cObj->stdWrap($content, $conf['stdWrap.']);
                                }
                }
-
                return $content;
        }
 
index 70a6a63..ae44637 100644 (file)
@@ -120,17 +120,19 @@ styles.content.searchresult {
 
 styles.content.media {
     # cat=content/cMedia/j1; type=; label= Video Player: configure the path to the video player
-  videoPlayer = typo3/contrib/flowplayer/flowplayer-3.2.7.swf
+  videoPlayer = typo3/contrib/flashmedia/flvplayer.swf
     # cat=content/cMedia/j2; type=int+; label= Media Video Width: define the default width for the media video
   defaultVideoWidth = 600
        # cat=content/cMedia/j3; type=int+; label= Media Video Height: define the default height for the media video
   defaultVideoHeight = 400
     # cat=content/cMedia/j4; type=; label= Audio Player: configure the path to the video player
-  audioPlayer = typo3/contrib/flowplayer/flowplayer-3.2.7.swf
+  audioPlayer = typo3/contrib/flashmedia/player.swf
        # cat=content/cMedia/j5; type=int+; label= Media Audio Width: define the default width for the media audio
   defaultAudioWidth = 300
     # cat=content/cMedia/j6; type=int+; label= Media Audio Height: define the default height for the media audio
-  defaultAudioHeight = 26
+  defaultAudioHeight = 30
+       # cat=content/cMedia/j7; type=; label= Flow Player: configure the path to the flow-player
+  flowPlayer = typo3/contrib/flowplayer/flowplayer-3.2.7.swf
 }
 
 styles.content.table {
index 88e5d63..23afb54 100644 (file)
@@ -1496,11 +1496,11 @@ tt_content.media {
                        asf = MEDIA
                        class = MEDIA
                        wmv = MEDIA
-                       mp3 = SWF
-                       mp4 = SWF
-                       m4v = SWF
-                       swa = SWF
-                       flv = SWF
+                       mp3 = FLOWPLAYER
+                       mp4 = FLOWPLAYER
+                       m4v = FLOWPLAYER
+                       swa = FLOWPLAYER
+                       flv = FLOWPLAYER
                        swf = SWF
                        mov = QT
                        m4v = QT
@@ -1509,6 +1509,9 @@ tt_content.media {
 
                mimeConf.swfobject < tt_content.swfobject.20
                mimeConf.qtobject < tt_content.qtobject.20
+               mimeConf.flowplayer < tt_content.swfobject.20
+               mimeConf.flowplayer.audio.player = {$styles.content.media.flowPlayer}
+               mimeConf.flowplayer.video.player = {$styles.content.media.flowPlayer}
 
        }
        20.stdWrap {