[TASK] Move Media cObject and CTypes to new extension 72/36572/5
authorBenjamin Mack <benni@typo3.org>
Mon, 2 Feb 2015 20:25:41 +0000 (21:25 +0100)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Sat, 28 Feb 2015 16:26:14 +0000 (17:26 +0100)
In order to separate features and also consolidate code for specific
features into one place, a new system extension is created.

The extension "mediace" ships with the core (not installed by default)
for now but could be moved to TER in future releases.

Next steps are:
- move third-party files from typo3/contrib/ to EXT:mediace
- find a proper solution to move the MediaWizard provider
- (optionally) create a Update Wizard that checks if the system uses
   media or multimedia elements or the "multimedia" and install the extension automatically.

Change-Id: I312ba6c15fece3a1319de23c085790590a659755
Resolves: #64719
Releases: master
Reviewed-on: http://review.typo3.org/36572
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
31 files changed:
typo3/sysext/cms/ext_localconf.php
typo3/sysext/cms/flexform_media.xml [deleted file]
typo3/sysext/core/Documentation/Changelog/master/Breaking-64719-MediaContentMovedToSystemExtension.rst [new file with mode: 0644]
typo3/sysext/css_styled_content/ext_localconf.php
typo3/sysext/css_styled_content/pageTSconfig.txt [deleted file]
typo3/sysext/css_styled_content/static/constants.txt
typo3/sysext/css_styled_content/static/setup.txt
typo3/sysext/frontend/Classes/ContentObject/FlowPlayerContentObject.php [deleted file]
typo3/sysext/frontend/Classes/ContentObject/MediaContentObject.php [deleted file]
typo3/sysext/frontend/Classes/ContentObject/MultimediaContentObject.php [deleted file]
typo3/sysext/frontend/Classes/ContentObject/QuicktimeObjectContentObject.php [deleted file]
typo3/sysext/frontend/Classes/ContentObject/ShockwaveFlashObjectContentObject.php [deleted file]
typo3/sysext/frontend/Configuration/TCA/tt_content.php
typo3/sysext/frontend/Tests/Unit/ContentObject/ContentObjectRendererTest.php
typo3/sysext/frontend/ext_tables.sql
typo3/sysext/mediace/Classes/ContentObject/FlowPlayerContentObject.php [new file with mode: 0644]
typo3/sysext/mediace/Classes/ContentObject/MediaContentObject.php [new file with mode: 0644]
typo3/sysext/mediace/Classes/ContentObject/MultimediaContentObject.php [new file with mode: 0644]
typo3/sysext/mediace/Classes/ContentObject/QuicktimeObjectContentObject.php [new file with mode: 0644]
typo3/sysext/mediace/Classes/ContentObject/ShockwaveFlashObjectContentObject.php [new file with mode: 0644]
typo3/sysext/mediace/Configuration/FlexForms/media.xml [new file with mode: 0644]
typo3/sysext/mediace/Configuration/TCA/Overrides/tt_content.php [new file with mode: 0644]
typo3/sysext/mediace/Configuration/TypoScript/constants.txt [new file with mode: 0644]
typo3/sysext/mediace/Configuration/TypoScript/setup.txt [new file with mode: 0644]
typo3/sysext/mediace/Migrations/Code/ClassAliasMap.php [new file with mode: 0644]
typo3/sysext/mediace/Migrations/Code/LegacyClassesForIde.php [new file with mode: 0644]
typo3/sysext/mediace/composer.json [new file with mode: 0644]
typo3/sysext/mediace/ext_emconf.php [new file with mode: 0644]
typo3/sysext/mediace/ext_icon.gif [new file with mode: 0644]
typo3/sysext/mediace/ext_localconf.php [new file with mode: 0644]
typo3/sysext/mediace/ext_tables.sql [new file with mode: 0644]

index fb88918..4bb5847 100644 (file)
@@ -78,22 +78,6 @@ mod.wizards.newContentElement {
                                        CType = uploads
                                }
                        }
-                       multimedia {
-                               icon = gfx/c_wiz/multimedia.gif
-                               title = LLL:EXT:cms/layout/locallang_db_new_content_el.xlf:special_multimedia_title
-                               description = LLL:EXT:cms/layout/locallang_db_new_content_el.xlf:special_multimedia_description
-                               tt_content_defValues {
-                                       CType = multimedia
-                               }
-                       }
-                       media {
-                               icon = gfx/c_wiz/multimedia.gif
-                               title = LLL:EXT:cms/layout/locallang_db_new_content_el.xlf:special_media_title
-                               description = LLL:EXT:cms/layout/locallang_db_new_content_el.xlf:special_media_description
-                               tt_content_defValues {
-                                       CType = media
-                               }
-                       }
                        menu {
                                icon = gfx/c_wiz/sitemap2.gif
                                title = LLL:EXT:cms/layout/locallang_db_new_content_el.xlf:special_menus_title
@@ -129,7 +113,7 @@ mod.wizards.newContentElement {
                        }
 
                }
-               special.show = uploads,media,menu,html,div,shortcut
+               special.show = uploads,menu,html,div,shortcut
 
                # dummy placeholder for forms group
                forms.header = LLL:EXT:cms/layout/locallang_db_new_content_el.xlf:forms
diff --git a/typo3/sysext/cms/flexform_media.xml b/typo3/sysext/cms/flexform_media.xml
deleted file mode 100644 (file)
index 8c818f3..0000000
+++ /dev/null
@@ -1,463 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<T3DataStructure>
-       <meta>
-               <langDisable>1</langDisable>
-       </meta>
-       <sheets>
-               <sGeneral>
-                       <ROOT>
-                               <TCEforms>
-                                       <sheetTitle>LLL:EXT:cms/locallang_ttc.xml:media.options</sheetTitle>
-                               </TCEforms>
-                               <type>array</type>
-                               <el>
-                                       <mmType>
-                                               <TCEforms>
-                                                       <onChange>reload</onChange>
-                                                       <label>LLL:EXT:cms/locallang_ttc.xml:media.type</label>
-                                                       <config>
-                                                               <type>select</type>
-                                                               <items>
-                                                                       <numIndex index="0">
-                                                                               <numIndex index="0">LLL:EXT:cms/locallang_ttc.xml:media.type.video</numIndex>
-                                                                               <numIndex index="1">video</numIndex>
-                                                                       </numIndex>
-                                                                       <numIndex index="1">
-                                                                               <numIndex index="0">LLL:EXT:cms/locallang_ttc.xml:media.type.audio</numIndex>
-                                                                               <numIndex index="1">audio</numIndex>
-                                                                       </numIndex>
-                                                               </items>
-                                                       </config>
-                                               </TCEforms>
-                                       </mmType>
-                                       <mmUseHTML5>
-                                               <TCEforms>
-                                                       <label>LLL:EXT:cms/locallang_ttc.xml:media.useHTML5</label>
-                                                       <displayCond>FIELD:mmType:!=:audio</displayCond>
-                                                       <onChange>reload</onChange>
-                                                       <config>
-                                                               <type>check</type>
-                                                               <default>0</default>
-                                                       </config>
-                                               </TCEforms>
-                                       </mmUseHTML5>
-                                       <mmWidth>
-                                               <TCEforms>
-                                                       <label>LLL:EXT:cms/locallang_ttc.xml:media.width</label>
-                                                       <config>
-                                                               <type>input</type>
-                                                               <size>8</size>
-                                                               <max>5</max>
-                                                               <eval>trim,num</eval>
-                                                       </config>
-                                               </TCEforms>
-                                       </mmWidth>
-                                       <mmHeight>
-                                               <TCEforms>
-                                                       <label>LLL:EXT:cms/locallang_ttc.xml:media.height</label>
-                                                       <config>
-                                                               <type>input</type>
-                                                               <size>8</size>
-                                                               <max>5</max>
-                                                               <eval>trim,num</eval>
-                                                       </config>
-                                               </TCEforms>
-                                       </mmHeight>
-                                       <mmRenderType>
-                                               <TCEforms>
-                                                       <label>LLL:EXT:cms/locallang_ttc.xml:media.renderType</label>
-                                                       <displayCond>FIELD:mmType:!=:audio</displayCond>
-                                                       <config>
-                                                               <type>select</type>
-                                                               <items>
-                                                                       <numIndex index="0">
-                                                                               <numIndex index="0">LLL:EXT:cms/locallang_ttc.xml:media.renderType.auto</numIndex>
-                                                                               <numIndex index="1">auto</numIndex>
-                                                                       </numIndex>
-                                                                       <numIndex index="1">
-                                                                               <numIndex index="0">LLL:EXT:cms/locallang_ttc.xml:media.renderType.qt</numIndex>
-                                                                               <numIndex index="1">qt</numIndex>
-                                                                       </numIndex>
-                                                                       <numIndex index="2">
-                                                                               <numIndex index="0">LLL:EXT:cms/locallang_ttc.xml:media.renderType.embed</numIndex>
-                                                                               <numIndex index="1">embed</numIndex>
-                                                                       </numIndex>
-                                                               </items>
-                                                               <itemsProcFunc>TYPO3\CMS\Frontend\Hooks\MediaItemHooks->customMediaRenderTypes</itemsProcFunc>
-                                                       </config>
-                                               </TCEforms>
-                                       </mmRenderType>
-                                       <mmMediaOptions>
-                                               <title>LLL:EXT:cms/locallang_ttc.xml:media.additionalOptions</title>
-                                               <type>array</type>
-                                               <section>1</section>
-                                               <el>
-                                                       <mmMediaOptionsContainer>
-                                                               <type>array</type>
-                                                               <title>LLL:EXT:cms/locallang_ttc.xml:media.params</title>
-                                                               <el>
-                                                                       <mmParamName>
-                                                                               <TCEforms>
-                                                                                       <label>LLL:EXT:cms/locallang_ttc.xml:media.params.option</label>
-                                                                                       <config>
-                                                                                               <type>select</type>
-                                                                                               <items>
-                                                                                                       <numIndex index="0">
-                                                                                                               <numIndex index="0">LLL:EXT:cms/locallang_ttc.xml:media.params.autoPlay</numIndex>
-                                                                                                               <numIndex index="1">autoPlay</numIndex>
-                                                                                                       </numIndex>
-                                                                                                       <numIndex index="1">
-                                                                                                               <numIndex index="0">LLL:EXT:cms/locallang_ttc.xml:media.params.loop</numIndex>
-                                                                                                               <numIndex index="1">loop</numIndex>
-                                                                                                       </numIndex>
-                                                                                                       <numIndex index="2">
-                                                                                                               <numIndex index="0">LLL:EXT:cms/locallang_ttc.xml:media.params.quality</numIndex>
-                                                                                                               <numIndex index="1">quality</numIndex>
-                                                                                                       </numIndex>
-                                                                                                       <numIndex index="3">
-                                                                                                               <numIndex index="0">LLL:EXT:cms/locallang_ttc.xml:media.params.preview</numIndex>
-                                                                                                               <numIndex index="1">preview</numIndex>
-                                                                                                       </numIndex>
-                                                                                                       <numIndex index="4">
-                                                                                                               <numIndex index="0">LLL:EXT:cms/locallang_ttc.xml:media.params.allowScriptAccess</numIndex>
-                                                                                                               <numIndex index="1">allowScriptAccess</numIndex>
-                                                                                                       </numIndex>
-                                                                                                       <numIndex index="5">
-                                                                                                               <numIndex index="0">LLL:EXT:cms/locallang_ttc.xml:media.params.allowFullScreen</numIndex>
-                                                                                                               <numIndex index="1">allowFullScreen</numIndex>
-                                                                                                       </numIndex>
-                                                                                                       <numIndex index="6">
-                                                                                                               <numIndex index="0">LLL:EXT:cms/locallang_ttc.xml:media.params.preload</numIndex>
-                                                                                                               <numIndex index="1">preload</numIndex>
-                                                                                                       </numIndex>
-                                                                                                       <numIndex index="7">
-                                                                                                               <numIndex index="0">LLL:EXT:cms/locallang_ttc.xml:media.params.controlsBelow</numIndex>
-                                                                                                               <numIndex index="1">controlsBelow</numIndex>
-                                                                                                       </numIndex>
-                                                                                                       <numIndex index="8">
-                                                                                                               <numIndex index="0">LLL:EXT:cms/locallang_ttc.xml:media.params.controlsAtStart</numIndex>
-                                                                                                               <numIndex index="1">controlsAtStart</numIndex>
-                                                                                                       </numIndex>
-                                                                                                       <numIndex index="9">
-                                                                                                               <numIndex index="0">LLL:EXT:cms/locallang_ttc.xml:media.params.controlsHiding</numIndex>
-                                                                                                               <numIndex index="1">controlsHiding</numIndex>
-                                                                                                       </numIndex>
-                                                                                                       <numIndex index="10">
-                                                                                                               <numIndex index="0">LLL:EXT:cms/locallang_ttc.xml:media.params.defaultVolume</numIndex>
-                                                                                                               <numIndex index="1">defaultVolume</numIndex>
-                                                                                                       </numIndex>
-                                                                                               </items>
-                                                                                               <itemsProcFunc>TYPO3\CMS\Frontend\Hooks\MediaItemHooks->customMediaParams</itemsProcFunc>
-                                                                                       </config>
-                                                                               </TCEforms>
-                                                                       </mmParamName>
-                                                                       <mmParamSet>
-                                                                               <TCEforms>
-                                                                                       <label>LLL:EXT:cms/locallang_ttc.xml:media.params.setTo</label>
-                                                                                       <config>
-                                                                                               <type>select</type>
-                                                                                               <items>
-                                                                                                       <numIndex index="0">
-                                                                                                               <numIndex index="0">LLL:EXT:cms/locallang_ttc.xml:media.params.on</numIndex>
-                                                                                                               <numIndex index="1">1</numIndex>
-                                                                                                       </numIndex>
-                                                                                                       <numIndex index="1">
-                                                                                                               <numIndex index="0">LLL:EXT:cms/locallang_ttc.xml:media.params.off</numIndex>
-                                                                                                               <numIndex index="1">0</numIndex>
-                                                                                                       </numIndex>
-                                                                                                       <numIndex index="2">
-                                                                                                               <numIndex index="0">LLL:EXT:cms/locallang_ttc.xml:media.params.valueEntry</numIndex>
-                                                                                                               <numIndex index="1">2</numIndex>
-                                                                                                       </numIndex>
-                                                                                               </items>
-                                                                                       </config>
-                                                                               </TCEforms>
-                                                                       </mmParamSet>
-                                                                       <mmParamValue>
-                                                                               <TCEforms>
-                                                                                       <label>LLL:EXT:cms/locallang_ttc.xml:media.params.value</label>
-                                                                                       <config>
-                                                                                               <type>input</type>
-                                                                                               <size>16</size>
-                                                                                               <default></default>
-                                                                                       </config>
-                                                                               </TCEforms>
-                                                                       </mmParamValue>
-                                                               </el>
-                                                       </mmMediaOptionsContainer>
-                                                       <mmMediaCustomParameterContainer>
-                                                               <type>array</type>
-                                                               <title>LLL:EXT:cms/locallang_ttc.xml:media.params.customEntry</title>
-                                                               <el>
-                                                                       <mmParamCustomEntry>
-                                                                               <TCEforms>
-                                                                                       <label>LLL:EXT:cms/locallang_ttc.xml:media.params.customEntryLabel</label>
-                                                                                       <config>
-                                                                                               <type>text</type>
-                                                                                               <rows>6</rows>
-                                                                                               <cols>60</cols>
-                                                                                       </config>
-                                                                               </TCEforms>
-                                                                       </mmParamCustomEntry>
-                                                               </el>
-                                                       </mmMediaCustomParameterContainer>
-                                               </el>
-                                       </mmMediaOptions>
-                               </el>
-                       </ROOT>
-               </sGeneral>
-               <sVideo>
-                       <ROOT>
-                               <TCEforms>
-                                       <sheetTitle>LLL:EXT:cms/locallang_ttc.xml:media.tabVideo</sheetTitle>
-                                       <displayCond>FIELD:sGeneral.mmType:!=:audio</displayCond>
-                               </TCEforms>
-                               <type>array</type>
-                               <el>
-                                       <mmFile>
-                                               <TCEforms>
-                                                       <label>LLL:EXT:cms/locallang_ttc.xml:media.fallbackUrl</label>
-                                                       <config>
-                                                               <type>input</type>
-                                                               <size>60</size>
-                                                               <eval>trim,required</eval>
-                                                               <default></default>
-                                                               <wizards type="array">
-                                                                       <link type="array">
-                                                                               <type>popup</type>
-                                                                               <title>LLL:EXT:cms/locallang_ttc.xml:media.browseUrlTitle</title>
-                                                                               <icon>link_popup.gif</icon>
-                                                                               <module type="array">
-                                                                                       <name>wizard_element_browser</name>
-                                                                                       <urlParameters type="array">
-                                                                                               <mode>wizard</mode>
-                                                                                               <act>file|url</act>
-                                                                                       </urlParameters>
-                                                                               </module>
-                                                                               <params type="array">
-                                                                                       <blindLinkOptions>page,folder,mail,spec</blindLinkOptions>
-                                                                                       <allowedExtensions>class,swa,dcr,wav,avi,au,mov,asf,mpg,wmv,mp3,mp4,m4v,m4a,flv,ogg,ogv,swf,webm</allowedExtensions>
-                                                                               </params>
-                                                                               <JSopenParams>height=300,width=500,status=0,menubar=0,scrollbars=1</JSopenParams>
-                                                                       </link>
-                                                               </wizards>
-                                                       </config>
-                                               </TCEforms>
-                                       </mmFile>
-                               </el>
-                       </ROOT>
-               </sVideo>
-               <sVideoAccessible>
-                       <ROOT>
-                               <TCEforms>
-                                       <sheetTitle>LLL:EXT:cms/locallang_ttc.xml:media.tabVideoAccessible</sheetTitle>
-                                       <displayCond>FIELD:sGeneral.mmUseHTML5:=:1</displayCond>
-                               </TCEforms>
-                               <type>array</type>
-                               <el>
-                                       <mmSources>
-                                               <title>LLL:EXT:cms/locallang_ttc.xml:media.sources</title>
-                                               <type>array</type>
-                                               <section>1</section>
-                                               <el>
-                                                       <mmSourcesContainer>
-                                                               <type>array</type>
-                                                               <title>LLL:EXT:cms/locallang_ttc.xml:media.media.url</title>
-                                                               <el>
-                                                                       <mmSource>
-                                                                               <TCEforms>
-                                                                                       <label>LLL:EXT:cms/locallang_ttc.xml:media.url</label>
-                                                                                       <config>
-                                                                                               <type>input</type>
-                                                                                               <size>60</size>
-                                                                                               <eval>trim,required</eval>
-                                                                                               <default></default>
-                                                                                               <wizards type="array">
-                                                                                                       <link type="array">
-                                                                                                               <type>popup</type>
-                                                                                                               <title>LLL:EXT:cms/locallang_ttc.xml:media.browseUrlTitle</title>
-                                                                                                               <icon>link_popup.gif</icon>
-                                                                                                               <module type="array">
-                                                                                                                       <name>wizard_element_browser</name>
-                                                                                                                       <urlParameters type="array">
-                                                                                                                               <mode>wizard</mode>
-                                                                                                                               <act>file|url</act>
-                                                                                                                       </urlParameters>
-                                                                                                               </module>
-                                                                                                               <params type="array">
-                                                                                                                       <blindLinkOptions>page,folder,mail,spec</blindLinkOptions>
-                                                                                                                       <allowedExtensions>mov,mpg,mp4,m4a,m4v,ogg,ogv,swf,webm</allowedExtensions>
-                                                                                                               </params>
-                                                                                                               <JSopenParams>height=300,width=500,status=0,menubar=0,scrollbars=1</JSopenParams>
-                                                                                                       </link>
-                                                                                               </wizards>
-                                                                                       </config>
-                                                                               </TCEforms>
-                                                                       </mmSource>
-                                                               </el>
-                                                       </mmSourcesContainer>
-                                               </el>
-                                       </mmSources>
-                                       <mmCaption>
-                                               <TCEforms>
-                                                       <label>LLL:EXT:cms/locallang_ttc.xml:media.captionUrl</label>
-                                                       <config>
-                                                               <type>input</type>
-                                                               <size>60</size>
-                                                               <eval>trim</eval>
-                                                               <default></default>
-                                                               <wizards type="array">
-                                                                       <link type="array">
-                                                                               <type>popup</type>
-                                                                               <title>LLL:EXT:cms/locallang_ttc.xml:media.browseUrlTitle</title>
-                                                                               <icon>link_popup.gif</icon>
-                                                                               <module type="array">
-                                                                                       <name>wizard_element_browser</name>
-                                                                                       <urlParameters type="array">
-                                                                                               <mode>wizard</mode>
-                                                                                               <act>file|url</act>
-                                                                                       </urlParameters>
-                                                                               </module>
-                                                                               <params type="array">
-                                                                                       <blindLinkOptions>page,folder,mail,spec</blindLinkOptions>
-                                                                                       <allowedExtensions>srt</allowedExtensions>
-                                                                               </params>
-                                                                               <JSopenParams>height=300,width=500,status=0,menubar=0,scrollbars=1</JSopenParams>
-                                                                       </link>
-                                                               </wizards>
-                                                       </config>
-                                               </TCEforms>
-                                       </mmCaption>
-                                       <mmAudioSources>
-                                               <title>LLL:EXT:cms/locallang_ttc.xml:media.audioDescription</title>
-                                               <type>array</type>
-                                               <section>1</section>
-                                               <el>
-                                                       <mmAudioSourcesContainer>
-                                                               <type>array</type>
-                                                               <title>LLL:EXT:cms/locallang_ttc.xml:media.media.browseUrl</title>
-                                                               <el>
-                                                                       <mmAudioSource>
-                                                                               <TCEforms>
-                                                                                       <label>LLL:EXT:cms/locallang_ttc.xml:media.browseUrl</label>
-                                                                                       <config>
-                                                                                               <type>input</type>
-                                                                                               <size>60</size>
-                                                                                               <eval>trim,required</eval>
-                                                                                               <default></default>
-                                                                                               <wizards type="array">
-                                                                                                       <link type="array">
-                                                                                                               <type>popup</type>
-                                                                                                               <title>LLL:EXT:cms/locallang_ttc.xml:media.browseUrlTitle</title>
-                                                                                                               <icon>link_popup.gif</icon>
-                                                                                                               <module type="array">
-                                                                                                                       <name>wizard_element_browser</name>
-                                                                                                                       <urlParameters type="array">
-                                                                                                                               <mode>wizard</mode>
-                                                                                                                               <act>file|url</act>
-                                                                                                                       </urlParameters>
-                                                                                                               </module>
-                                                                                                               <params type="array">
-                                                                                                                       <blindLinkOptions>page,folder,mail,spec</blindLinkOptions>
-                                                                                                                       <allowedExtensions>au,asf,mp3,m4a,oga,ogg, wav,webm,wmv</allowedExtensions>
-                                                                                                               </params>
-                                                                                                               <JSopenParams>height=300,width=500,status=0,menubar=0,scrollbars=1</JSopenParams>
-                                                                                                       </link>
-                                                                                               </wizards>
-                                                                                       </config>
-                                                                               </TCEforms>
-                                                                       </mmAudioSource>
-                                                               </el>
-                                                       </mmAudioSourcesContainer>
-                                               </el>
-                                       </mmAudioSources>
-
-                               </el>
-                       </ROOT>
-               </sVideoAccessible>
-               <sAudio>
-                       <ROOT>
-                               <TCEforms>
-                                       <sheetTitle>LLL:EXT:cms/locallang_ttc.xml:media.tabAudio</sheetTitle>
-                                       <displayCond>FIELD:sGeneral.mmType:=:audio</displayCond>
-                               </TCEforms>
-                               <type>array</type>
-                               <el>
-                                       <mmAudioFallback>
-                                               <TCEforms>
-                                                       <label>LLL:EXT:cms/locallang_ttc.xml:media.audioFallbackUrl</label>
-                                                       <config>
-                                                               <type>input</type>
-                                                               <size>60</size>
-                                                               <eval>trim</eval>
-                                                               <default></default>
-                                                               <wizards type="array">
-                                                                       <link type="array">
-                                                                               <type>popup</type>
-                                                                               <title>LLL:EXT:cms/locallang_ttc.xml:media.browseUrlTitle</title>
-                                                                               <icon>link_popup.gif</icon>
-                                                                               <module type="array">
-                                                                                       <name>wizard_element_browser</name>
-                                                                                       <urlParameters type="array">
-                                                                                               <mode>wizard</mode>
-                                                                                               <act>file|url</act>
-                                                                                       </urlParameters>
-                                                                               </module>
-                                                                               <params type="array">
-                                                                                       <blindLinkOptions>page,folder,mail,spec</blindLinkOptions>
-                                                                                       <allowedExtensions>au,asf,mp3,m4a,oga,swa,wav,webm,wmv</allowedExtensions>
-                                                                               </params>
-                                                                               <JSopenParams>height=300,width=500,status=0,menubar=0,scrollbars=1</JSopenParams>
-                                                                       </link>
-                                                               </wizards>
-                                                       </config>
-                                               </TCEforms>
-                                       </mmAudioFallback>
-                                       <mmAudioSources>
-                                               <title>LLL:EXT:cms/locallang_ttc.xml:media.audioSources</title>
-                                               <type>array</type>
-                                               <section>1</section>
-                                               <el>
-                                                       <mmAudioSourcesContainer>
-                                                               <type>array</type>
-                                                               <title>LLL:EXT:cms/locallang_ttc.xml:media.media.url</title>
-                                                               <el>
-                                                                       <mmAudioSource>
-                                                                               <TCEforms>
-                                                                                       <label>LLL:EXT:cms/locallang_ttc.xml:media.url</label>
-                                                                                       <config>
-                                                                                               <type>input</type>
-                                                                                               <size>60</size>
-                                                                                               <eval>trim,required</eval>
-                                                                                               <default></default>
-                                                                                               <wizards type="array">
-                                                                                                       <link type="array">
-                                                                                                               <type>popup</type>
-                                                                                                               <title>LLL:EXT:cms/locallang_ttc.xml:media.browseUrlTitle</title>
-                                                                                                               <icon>link_popup.gif</icon>
-                                                                                                               <module type="array">
-                                                                                                                       <name>wizard_element_browser</name>
-                                                                                                                       <urlParameters type="array">
-                                                                                                                               <mode>wizard</mode>
-                                                                                                                               <act>file|url</act>
-                                                                                                                       </urlParameters>
-                                                                                                               </module>
-                                                                                                               <params type="array">
-                                                                                                                       <blindLinkOptions>page,folder,mail,spec</blindLinkOptions>
-                                                                                                                       <allowedExtensions>au,asf,mp3,m4a,oga,ogg, wav,webm,wmv</allowedExtensions>
-                                                                                                               </params>
-                                                                                                               <JSopenParams>height=300,width=500,status=0,menubar=0,scrollbars=1</JSopenParams>
-                                                                                                       </link>
-                                                                                               </wizards>
-                                                                                       </config>
-                                                                               </TCEforms>
-                                                                       </mmAudioSource>
-                                                               </el>
-                                                       </mmAudioSourcesContainer>
-                                               </el>
-                                       </mmAudioSources>
-                               </el>
-                       </ROOT>
-               </sAudio>
-       </sheets>
-</T3DataStructure>
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Breaking-64719-MediaContentMovedToSystemExtension.rst b/typo3/sysext/core/Documentation/Changelog/master/Breaking-64719-MediaContentMovedToSystemExtension.rst
new file mode 100644 (file)
index 0000000..c129b79
--- /dev/null
@@ -0,0 +1,39 @@
+====================================================================================================
+Breaking: #64719 - Multimedia and Media cObjects and Content Types are moved to new system extension
+====================================================================================================
+
+Description
+===========
+
+The Content Element Types "media" and "multimedia" has been extracted into one single place, which is an
+extension called "mediace". This extension is not installed by default but is shipped with the core.
+
+The following Content Objects are not available anymore by default:
+
+       * MULTIMEDIA
+       * MEDIA
+       * SWFOBJECT
+       * FLOWPLAYER
+       * QTOBJECT
+
+The Content Types "media" and "multimedia" are not available anymore by default.
+
+The table column ``tt_content.multimedia`` is not available anymore by default.
+
+Impact
+======
+
+Any TypoScript using any of the cObjects directly or Content Elements with the CType "media" or "multimedia"
+will result in no output. Existing Content Elements of this type can not be edited anymore.
+
+
+Affected installations
+======================
+
+TYPO3 CMS 7 installations still using any of the cObjects or having Content Elements of CType "media" or "multimedia".
+
+
+Migration
+=========
+
+Install the system extension "mediace" to regain all functionality as it was before.
index 7b03815..f5bb9e3 100644 (file)
@@ -4,7 +4,10 @@ defined('TYPO3_MODE') or die();
 // unserializing the configuration so we can use it here:
 $_EXTCONF = unserialize($_EXTCONF);
 if (!$_EXTCONF || $_EXTCONF['setPageTSconfig']) {
-       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig('<INCLUDE_TYPOSCRIPT: source="FILE:EXT:css_styled_content/pageTSconfig.txt">');
+       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig('
+               # Removes obsolete type values and fields from "Content Element" table "tt_content"
+               TCEFORM.tt_content.image_frames.disabled = 1
+       ');
 }
 if (!$_EXTCONF || $_EXTCONF['removePositionTypes']) {
        \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig('
diff --git a/typo3/sysext/css_styled_content/pageTSconfig.txt b/typo3/sysext/css_styled_content/pageTSconfig.txt
deleted file mode 100644 (file)
index db898a4..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-# ***************************************************************************************
-# Page TSconfig for "css_styled_content"
-#
-# Removes obsolete type values and fields from "Content Element" table "tt_content"
-# ***************************************************************************************
-
-TCEFORM.tt_content {
-       image_frames.disabled = 1
-
-       CType.removeItems = swfobject,qtobject,multimedia
-}
index 86a02b9..3515cd1 100644 (file)
@@ -107,23 +107,6 @@ styles.content.loginform {
   templateFile = EXT:felogin/template.html
 }
 
-styles.content.media {
-    # cat=content/cMedia/j1; type=; label= Video Player: configure the path to the video player
-  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/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 = 30
-       # cat=content/cMedia/j7; type=; label= Flow Player: configure the path to the flow-player
-  flowPlayer = typo3/contrib/flowplayer/flowplayer-3.2.16.swf
-}
-
 styles.content.table {
     # cat=content/cTable/k2; type=color; label= Table background color, Color 1: Background color for table when "Backgr. Color" has been set to "Color 1"
   backgroundColor.1 = #EDEBF1
index 3ba0d83..3d11d4d 100644 (file)
@@ -1407,199 +1407,6 @@ tt_content.table {
        }
 }
 
-# ******************
-# CType: multimedia
-# ******************
-tt_content.multimedia = COA
-tt_content.multimedia {
-       10 = < lib.stdheader
-
-       20 = MULTIMEDIA
-       20.file.field = multimedia
-       20.file.wrap = uploads/media/
-       20.file.listNum = 0
-       20.params.field = bodytext
-
-       20.stdWrap {
-               editIcons = tt_content: multimedia, bodytext
-               editIcons.iconTitle.data = LLL:EXT:css_styled_content/Resources/Private/Language/locallang.xlf:eIcon.multimedia
-
-               prefixComment = 2 | Multimedia element:
-       }
-}
-
-# *****************
-# CType: swfobject
-# *****************
-tt_content.swfobject = COA
-tt_content.swfobject {
-       10 = < lib.stdheader
-
-       20 = SWFOBJECT
-       20 {
-               file =
-               width =
-               height =
-
-               flexParams.field = pi_flexform
-
-               alternativeContent.field = bodytext
-
-               layout = ###SWFOBJECT###
-
-               video {
-                       player = {$styles.content.media.videoPlayer}
-
-                       defaultWidth  = {$styles.content.media.defaultVideoWidth}
-                       defaultHeight  = {$styles.content.media.defaultVideoHeight}
-
-                       default {
-                               params.quality = high
-                               params.menu = false
-                               params.allowScriptAccess = sameDomain
-                               params.allowFullScreen = true
-                       }
-                       mapping {
-
-                       }
-               }
-
-               audio {
-                       player = {$styles.content.media.audioPlayer}
-
-                       defaultWidth = {$styles.content.media.defaultAudioWidth}
-                       defaultHeight = {$styles.content.media.defaultAudioHeight}
-
-                       default {
-                               params.quality = high
-                               params.allowScriptAccess = sameDomain
-                               params.menu = false
-                       }
-                       mapping {
-                               flashvars.file = soundFile
-                       }
-               }
-
-       }
-       20.stdWrap {
-               editIcons = tt_content: multimedia, imagewidth, imageheight, pi_flexform, bodytext
-               editIcons.iconTitle.data = LLL:EXT:css_styled_content/Resources/Private/Language/locallang.xlf:eIcon.multimedia
-
-               prefixComment = 2 | SWFobject element:
-       }
-}
-
-# *****************
-# CType: qtobject
-# *****************
-tt_content.qtobject = COA
-tt_content.qtobject {
-       10 = < lib.stdheader
-
-       20 = QTOBJECT
-       20 {
-               file =
-               width =
-               height =
-
-               flexParams.field = pi_flexform
-
-               alternativeContent.field = bodytext
-
-               layout = ###QTOBJECT###
-
-               video {
-                       player = {$styles.content.media.videoPlayer}
-
-                       defaultWidth  = {$styles.content.media.defaultVideoWidth}
-                       defaultHeight  = {$styles.content.media.defaultVideoHeight}
-
-                       default {
-                               params.quality = high
-                               params.menu = false
-                               params.allowScriptAccess = sameDomain
-                               params.allowFullScreen = true
-                       }
-                       mapping {
-
-                       }
-               }
-
-               audio {
-                       player = {$styles.content.media.audioPlayer}
-
-                       defaultWidth = {$styles.content.media.defaultAudioWidth}
-                       defaultHeight = {$styles.content.media.defaultAudioHeight}
-
-                       default {
-                               params.quality = high
-                               params.allowScriptAccess = sameDomain
-                               params.menu = false
-                       }
-                       mapping {
-                               flashvars.file = soundFile
-                       }
-               }
-       }
-       20.stdWrap {
-               editIcons = tt_content: multimedia, imagewidth, imageheight, pi_flexform, bodytext
-               editIcons.iconTitle.data = LLL:EXT:css_styled_content/Resources/Private/Language/locallang.xlf:eIcon.multimedia
-
-               prefixComment = 2 | QTobject element:
-       }
-}
-
-# *****************
-# CType: media
-# *****************
-tt_content.media = COA
-tt_content.media {
-       10 = < lib.stdheader
-
-       20 = MEDIA
-       20 {
-
-               flexParams.field = pi_flexform
-               alternativeContent < tt_content.text.20
-               alternativeContent.field = bodytext
-
-               type = video
-               renderType = auto
-               allowEmptyUrl = 0
-               forcePlayer = 1
-
-               fileExtHandler {
-                       default = MEDIA
-                       avi = MEDIA
-                       asf = MEDIA
-                       class = MEDIA
-                       wmv = MEDIA
-                       mp3 = SWF
-                       mp4 = SWF
-                       m4v = SWF
-                       swa = SWF
-                       flv = SWF
-                       swf = SWF
-                       mov = QT
-                       m4v = QT
-                       m4a = QT
-               }
-
-               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 {
-               editIcons = tt_content: pi_flexform, bodytext
-               editIcons.iconTitle.data = LLL:EXT:css_styled_content/Resources/Private/Language/locallang.xlf:eIcon.multimedia
-
-               prefixComment = 2 | Media element:
-       }
-}
-
 # ****************
 # CType: menu
 # ****************
diff --git a/typo3/sysext/frontend/Classes/ContentObject/FlowPlayerContentObject.php b/typo3/sysext/frontend/Classes/ContentObject/FlowPlayerContentObject.php
deleted file mode 100644 (file)
index e8c1f54..0000000
+++ /dev/null
@@ -1,721 +0,0 @@
-<?php
-namespace TYPO3\CMS\Frontend\ContentObject;
-
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-use TYPO3\CMS\Core\Utility\ArrayUtility;
-
-/**
- * Contains FlowPlayer class object.
- *
- * @author Stanislas Rolland
- */
-class FlowPlayerContentObject extends AbstractContentObject {
-
-       /**
-        * File extension to mime type
-        *
-        * @var array
-        */
-       public $mimeTypes = array(
-               'aif' => array(
-                       'audio' => 'audio/aiff'
-               ),
-               'au' => array(
-                       'audio' => 'audio/x-au'
-               ),
-               'avi' => array(
-                       'audio' => 'video/x-msvideo'
-               ),
-               'asf' => array(
-                       'video' => 'video/x-ms-asf'
-               ),
-               'class' => array(
-                       'audio' => 'application/java',
-                       'video' => 'application/java'
-               ),
-               'dcr' => array(
-                       'video' => 'application/x-director'
-               ),
-               'flac' => array(
-                       'audio' => 'audio/flac'
-               ),
-               'flv' => array(
-                       'video' => 'video/x-flv'
-               ),
-               'mp3' => array(
-                       'audio' => 'audio/mpeg'
-               ),
-               'mp4' => array(
-                       'video' => 'video/mp4'
-               ),
-               'oga' => array(
-                       'audio' => 'audio/ogg'
-               ),
-               'ogg' => array(
-                       'audio' => 'audio/ogg',
-                       'video' => 'video/ogg'
-               ),
-               'ogv' => array(
-                       'video' => 'video/ogg'
-               ),
-               'swa' => array(
-                       'audio' => 'audio/x-m4a'
-               ),
-               'mov' => array(
-                       'video' => 'video/quicktime'
-               ),
-               'm4a' => array(
-                       'audio' => 'audio/mp4a-latm'
-               ),
-               'm4v' => array(
-                       'video' => 'video/x-m4v'
-               ),
-               'qt' => array(
-                       'video' => 'video/quicktime'
-               ),
-               'swa' => array(
-                       'audio' => 'application/x-director'
-               ),
-               'swf' => array(
-                       'audio' => 'application/x-shockwave-flash',
-                       'video' => 'application/x-shockwave-flash'
-               ),
-               'wav' => array(
-                       'audio' => 'audio/wave'
-               ),
-               'webm' => array(
-                       'audio' => 'audio/webm',
-                       'video' => 'video/webm'
-               ),
-               'wmv' => array(
-                       'audio' => 'audio/x-ms-wmv'
-               )
-       );
-
-       /**
-        * VideoJS options
-        *
-        * @var array
-        */
-       public $videoJsOptions = array(
-               // Use the browser's controls (iPhone)
-               'useBuiltInControls',
-               // Display control bar below video vs. in front of
-               'controlsBelow',
-               // Make controls visible when page loads
-               'controlsAtStart',
-               // Hide controls when not over the video
-               'controlsHiding',
-               // Will be overridden by localStorage volume if available
-               'defaultVolume',
-               // Players and order to use them
-               'playerFallbackOrder'
-       );
-
-       /**
-        * html5 tag attributes
-        *
-        * @var array
-        */
-       public $html5TagAttributes = array(
-               'autoPlay',
-               'controls',
-               'loop',
-               'preload'
-       );
-
-       /**
-        * Flowplayer captions plugin configuration
-        *
-        * @var array
-        */
-       public $flowplayerCaptionsConfig = array(
-               'plugins' => array(
-                       // The captions plugin
-                       'captions' => array(
-                               'url' => 'plugins/flowplayer.captions-3.2.9.swf',
-                               // Pointer to a content plugin (see below)
-                               'captionTarget' => 'content'
-                       ),
-                       // Configure a content plugin so that it looks good for showing captions
-                       'content' => array(
-                               'url' => 'plugins/flowplayer.content-3.2.8.swf',
-                               'bottom' => 5,
-                               'height' => 40,
-                               'backgroundColor' => 'transparent',
-                               'backgroundGradient' => 'none',
-                               'border' => 0,
-                               'textDecoration' => 'outline',
-                               'style' => array(
-                                       'body' => array(
-                                               'fontSize' => 14,
-                                               'fontFamily' => 'Arial',
-                                               'textAlign' => 'center',
-                                               'color' => '#ffffff'
-                                       )
-                               )
-                       )
-               )
-       );
-
-       /**
-        * Flowplayer audio configuration
-        *
-        * @var array
-        */
-       public $flowplayerAudioConfig = array(
-               'provider' => 'audio',
-               'plugins' => array(
-                       'audio' => array(
-                               'url' => 'plugins/flowplayer.audio-3.2.10.swf'
-                       ),
-                       'controls' => array(
-                               'autoHide' => FALSE,
-                               'fullscreen' => FALSE
-                       )
-               )
-       );
-
-       /**
-        * Flowplayer configuration for the audio description
-        *
-        * @var array
-        */
-       public $flowplayerAudioDescriptionConfig = array(
-               // The controls plugin
-               'plugins' => array(
-                       'controls' => NULL
-               )
-       );
-
-       /**
-        * Rendering the cObject, SWFOBJECT
-        *
-        * @param array $conf Array of TypoScript properties
-        * @return string Output
-        */
-       public function render($conf = array()) {
-               /** @var $pageRenderer \TYPO3\CMS\Core\Page\PageRenderer */
-               $pageRenderer = $GLOBALS['TSFE']->getPageRenderer();
-               $prefix = '';
-               if ($GLOBALS['TSFE']->baseUrl) {
-                       $prefix = $GLOBALS['TSFE']->baseUrl;
-               }
-               if ($GLOBALS['TSFE']->absRefPrefix) {
-                       $prefix = $GLOBALS['TSFE']->absRefPrefix;
-               }
-               // Initialize content
-               $replaceElementIdString = str_replace('.', '', uniqid('mmswf', TRUE));
-               $GLOBALS['TSFE']->register['MMSWFID'] = $replaceElementIdString;
-               $layout = isset($conf['layout.']) ? $this->cObj->stdWrap($conf['layout'], $conf['layout.']) : $conf['layout'];
-               $content = str_replace('###ID###', $replaceElementIdString, $layout);
-               $type = isset($conf['type.']) ? $this->cObj->stdWrap($conf['type'], $conf['type.']) : $conf['type'];
-               $typeConf = $conf[$type . '.'];
-               // Add Flowplayer js-file
-               $pageRenderer->addJsFile(TYPO3_mainDir . 'contrib/flowplayer/flowplayer-3.2.12.min.js');
-               // Add Flowpayer css for exprss install
-               $pageRenderer->addCssFile(TYPO3_mainDir . 'contrib/flowplayer/express-install/express-install.css');
-               // Add videoJS js-file
-               $pageRenderer->addJsFile(TYPO3_mainDir . 'contrib/videojs/video-js/video.js');
-               // Add videoJS js-file
-               $pageRenderer->addJsFile(TYPO3_mainDir . 'contrib/videojs/video-js/video.js');
-               // Add videoJS css-file
-               $pageRenderer->addCssFile(TYPO3_mainDir . 'contrib/videojs/video-js/video-js.css');
-               // Add extended videoJS control bar
-               $pageRenderer->addJsFile(TYPO3_mainDir . 'contrib/videojs/video-js/controls/control-bar.js');
-               $pageRenderer->addCssFile(TYPO3_mainDir . 'contrib/videojs/video-js/controls/control-bar.css');
-               // Build Flash configuration
-               $player = isset($typeConf['player.']) ? $this->cObj->stdWrap($typeConf['player'], $typeConf['player.']) : $typeConf['player'];
-               if (!$player) {
-                       $player = $prefix . TYPO3_mainDir . 'contrib/flowplayer/flowplayer-3.2.16.swf';
-               }
-               $installUrl = isset($conf['installUrl.']) ? $this->cObj->stdWrap($conf['installUrl'], $conf['installUrl.']) : $conf['installUrl'];
-               if (!$installUrl) {
-                       $installUrl = $prefix . TYPO3_mainDir . 'contrib/flowplayer/expressinstall.swf';
-               }
-               $flashVersion = isset($conf['flashVersion.']) ? $this->cObj->stdWrap($conf['flashVersion'], $conf['flashVersion.']) : $conf['flashVersion'];
-               if (!$flashVersion) {
-                       $flashVersion = array(9, 115);
-               }
-               $flashConfiguration = array(
-                       // Flowplayer component
-                       'src' => $player,
-                       // Express install url
-                       'expressInstall' => $installUrl,
-                       // Require at least this Flash version
-                       'version' => $flashVersion,
-                       // Older versions will see a message
-                       'onFail' => '###ONFAIL###'
-               );
-               $flashDownloadUrl = 'http://www.adobe.com/go/getflashplayer';
-               $onFail = 'function()  {
-                       if (!(flashembed.getVersion()[0] > 0)) {
-                               var message = "<p>" + "' . $GLOBALS['TSFE']->sL('LLL:EXT:cms/locallang_ttc.xlf:media.needFlashPlugin') . '" + "</p>" + "<p>" + "<a href=\\"' . $flashDownloadUrl . '\\">' . $GLOBALS['TSFE']->sL('LLL:EXT:cms/locallang_ttc.xlf:media.downloadFlash') . '</a>" + "</p>";
-                               document.getElementById("' . $replaceElementIdString . '_flash_install_info").innerHTML = "<div class=\\"message\\">" + message + "</div>";
-                       }
-               }';
-               $flashConfiguration = json_encode($flashConfiguration);
-               $flashConfiguration = str_replace('"###ONFAIL###"', $onFail, $flashConfiguration);
-               $filename = isset($conf['file.']) ? $this->cObj->stdWrap($conf['file'], $conf['file.']) : $conf['file'];
-               if ($filename) {
-                       if (strpos($filename, '://') !== FALSE) {
-                               $conf['flashvars.']['url'] = $filename;
-                       } else {
-                               if ($prefix) {
-                                       $conf['flashvars.']['url'] = $prefix . $filename;
-                               } else {
-                                       $conf['flashvars.']['url'] = str_repeat('../', substr_count($player, '/')) . $filename;
-                               }
-                       }
-               }
-               if (is_array($conf['sources'])) {
-                       foreach ($conf['sources'] as $key => $source) {
-                               if (strpos($source, '://') === FALSE) {
-                                       $conf['sources'][$key] = $prefix . $source;
-                               }
-                       }
-               }
-               if (is_array($conf['audioSources'])) {
-                       foreach ($conf['audioSources'] as $key => $source) {
-                               if (strpos($source, '://') === FALSE) {
-                                       $conf['audioSources'][$key] = $prefix . $source;
-                               }
-                       }
-               }
-               if (isset($conf['audioFallback']) && strpos($conf['audioFallback'], '://') === FALSE) {
-                       $conf['audioFallback'] = $prefix . $conf['audioFallback'];
-               }
-               if (isset($conf['caption']) && strpos($conf['caption'], '://') === FALSE) {
-                       $conf['caption'] = $prefix . $conf['caption'];
-               }
-               // Write calculated values in conf for the hook
-               $conf['player'] = $player ?: $filename;
-               $conf['installUrl'] = $installUrl;
-               $conf['filename'] = $conf['flashvars.']['url'];
-               $conf['prefix'] = $prefix;
-               // merge with default parameters
-               $conf['flashvars.'] = array_merge((array)$typeConf['default.']['flashvars.'], (array)$conf['flashvars.']);
-               $conf['params.'] = array_merge((array)$typeConf['default.']['params.'], (array)$conf['params.']);
-               $conf['attributes.'] = array_merge((array)$typeConf['default.']['attributes.'], (array)$conf['attributes.']);
-               $conf['embedParams'] = 'flashvars, params, attributes';
-               // Hook for manipulating the conf array, it's needed for some players like flowplayer
-               if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/hooks/class.tx_cms_mediaitems.php']['swfParamTransform'])) {
-                       foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/hooks/class.tx_cms_mediaitems.php']['swfParamTransform'] as $classRef) {
-                               \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($classRef, $conf, $this);
-                       }
-               }
-               // Flowplayer config
-               $flowplayerVideoConfig = array();
-               $flowplayerAudioConfig = array();
-               if (is_array($conf['flashvars.'])) {
-                       ArrayUtility::remapArrayKeys($conf['flashvars.'], $typeConf['mapping.']['flashvars.']);
-               } else {
-                       $conf['flashvars.'] = array();
-               }
-               $conf['videoflashvars'] = $conf['flashvars.'];
-               $conf['audioflashvars'] = $conf['flashvars.'];
-               $conf['audioflashvars']['url'] = $conf['audioFallback'];
-               // Render video sources
-               $videoSources = '';
-               if (is_array($conf['sources'])) {
-                       foreach ($conf['sources'] as $source) {
-                               $fileinfo = \TYPO3\CMS\Core\Utility\GeneralUtility::split_fileref($source);
-                               $mimeType = $this->mimeTypes[$fileinfo['fileext']]['video'];
-                               $videoSources .= '<source src="' . $source . '"' . ($mimeType ? ' type="' . $mimeType . '"' : '') . ' />' . LF;
-                       }
-               }
-               // Render audio sources
-               $audioSources = '';
-               if (is_array($conf['audioSources'])) {
-                       foreach ($conf['audioSources'] as $source) {
-                               $fileinfo = \TYPO3\CMS\Core\Utility\GeneralUtility::split_fileref($source);
-                               $mimeType = $this->mimeTypes[$fileinfo['fileext']]['audio'];
-                               $audioSources .= '<source src="' . $source . '"' . ($mimeType ? ' type="' . $mimeType . '"' : '') . ' />' . LF;
-                       }
-               }
-               // Configure captions
-               if ($conf['type'] === 'video' && isset($conf['caption'])) {
-                       // Assemble captions track tag
-                       $videoCaptions = '<track id="' . $replaceElementIdString . '_captions_track" kind="captions" src="' . $conf['caption'] . '"></track>' . LF;
-                       // Add videoJS extension for captions
-                       $pageRenderer->addJsFile(TYPO3_mainDir . 'contrib/videojs/video-js/controls/captions.js');
-                       // Flowplayer captions
-                       $conf['videoflashvars']['captionUrl'] = $conf['caption'];
-                       // Flowplayer captions plugin configuration
-                       $flowplayerVideoConfig = array_merge_recursive($flowplayerVideoConfig, $this->flowplayerCaptionsConfig);
-               }
-               // Configure flowplayer audio fallback
-               if (isset($conf['audioFallback'])) {
-                       $flowplayerAudioConfig = array_merge_recursive($flowplayerAudioConfig, $this->flowplayerAudioConfig);
-               }
-               // Configure audio description
-               if ($conf['type'] == 'video') {
-                       if (is_array($conf['audioSources']) && count($conf['audioSources'])) {
-                               // Add videoJS audio description toggle
-                               $pageRenderer->addJsFile(TYPO3_mainDir . 'contrib/videojs/video-js/controls/audio-description.js');
-                       }
-                       if (isset($conf['audioFallback'])) {
-                               // Audio description flowplayer config (remove controls)
-                               $flowplayerAudioConfig = array_merge_recursive($flowplayerAudioConfig, $this->flowplayerAudioDescriptionConfig);
-                       }
-               }
-               // Assemble Flowplayer configuration
-               if (count($conf['videoflashvars'])) {
-                       $flowplayerVideoConfig = array_merge_recursive($flowplayerVideoConfig, array('clip' => $conf['videoflashvars']));
-               }
-               $flowplayerVideoJsonConfig = str_replace(array('"true"', '"false"'), array('true', 'false'), json_encode($flowplayerVideoConfig));
-               if (count($conf['audioflashvars'])) {
-                       $flowplayerAudioConfig = array_merge_recursive($flowplayerAudioConfig, array('clip' => $conf['audioflashvars']));
-               }
-               $flowplayerAudioJsonConfig = str_replace(array('"true"', '"false"'), array('true', 'false'), json_encode($flowplayerAudioConfig));
-               // Assemble param tags (required?)
-               if (is_array($conf['params.'])) {
-                       ArrayUtility::remapArrayKeys($conf['params.'], $typeConf['mapping.']['params.']);
-               }
-               $videoFlashParams = '';
-               if (is_array($conf['params.'])) {
-                       foreach ($conf['params.'] as $name => $value) {
-                               $videoFlashParams .= '<param name="' . $name . '" value="' . $value . '" />' . LF;
-                       }
-               }
-               $audioFlashParams = $videoFlashParams;
-               // Required param tags
-               $videoFlashParams .= '<param name="movie" value="' . $player . '" />' . LF;
-               $videoFlashParams .= '<param name="flashvars" value=\'config=' . $flowplayerVideoJsonConfig . '\' />' . LF;
-               $audioFlashParams .= '<param name="movie" value="' . $player . '" />' . LF;
-               $audioFlashParams .= '<param name="flashvars" value=\'config=' . $flowplayerAudioJsonConfig . '\' />' . LF;
-               // Assemble audio/video tag attributes
-               $attributes = '';
-               if (is_array($conf['attributes.'])) {
-                       ArrayUtility::remapArrayKeys($conf['attributes.'], $typeConf['attributes.']['params.']);
-               }
-               foreach ($this->html5TagAttributes as $attribute) {
-                       if ($conf['attributes.'][$attribute] === 'true' || $conf['attributes.'][$attribute] === strToLower($attribute) || $conf['attributes.'][$attribute] === $attribute) {
-                               $attributes .= strToLower($attribute) . '="' . strToLower($attribute) . '" ';
-                       }
-               }
-               // Media dimensions
-               $width = isset($conf['width.']) ? $this->cObj->stdWrap($conf['width'], $conf['width.']) : $conf['width'];
-               if (!$width) {
-                       $width = $conf[$type . '.']['defaultWidth'];
-               }
-               $height = isset($conf['height.']) ? $this->cObj->stdWrap($conf['height'], $conf['height.']) : $conf['height'];
-               if (!$height) {
-                       $height = $conf[$type . '.']['defaultHeight'];
-               }
-               // Alternate content
-               $alternativeContent = isset($conf['alternativeContent.']) ? $this->cObj->stdWrap($conf['alternativeContent'], $conf['alternativeContent.']) : $conf['alternativeContent'];
-               // 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;
-                               $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>';
-                               }
-                               $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>';
-                               $content = str_replace('###SWFOBJECT###', '<div id="' . $replaceElementIdString . '_video" class="video-js-box" style="width:' . $width . 'px; height:' . $height . 'px;">' . LF . $divContent . '</div>', $content);
-                       }
-               }
-               // Render audio
-               if ($conf['type'] === 'audio' || $audioSources || isset($conf['audioFallback'])) {
-                       if ($conf['preferFlashOverHtml5']) {
-                               // Flash with audio tag fallback
-                               $flashDivContent = $audioFlashParams . LF . '<audio id="' . $replaceElementIdString . '_audio_element"' . $attributes . ($conf['type'] === 'video' ? ' mediagroup="' . $replaceElementIdString . 'style="position:absolute;left:-10000px;"' : ' controls="controls"') . ' style="width:' . $width . 'px; height:' . $height . 'px;">' . LF . $audioSources . $alternativeContent . LF . '</audio>' . LF;
-                               $divContent = ($conf['type'] === 'video' ? '' : '<div id="' . $replaceElementIdString . '_flash_install_info" class="flash-install-info"></div>' . LF) . '<noscript>' . LF . '<object id="' . $replaceElementIdString . '_audio_flash" type="application/x-shockwave-flash" data="' . $player . '" width="' . ($conf['type'] === 'video' ? 0 : $width) . '" height="' . ($conf['type'] === 'video' ? 0 : $height) . '">' . LF . $flashDivContent . '</object>' . LF . '</noscript>' . LF;
-                               $audioContent = '<div id="' . $replaceElementIdString . '_audio_box" class="audio-flash-container" style="width:' . ($conf['type'] === 'video' ? 0 : $width) . 'px; height:' . ($conf['type'] === 'video' ? 0 : $height) . 'px;">' . LF . $divContent . '</div>';
-                       } else {
-                               // Audio tag with Flash fallback
-                               $audioTagContent = $audioSources;
-                               if (isset($conf['audioflashvars']['url'])) {
-                                       $audioTagContent .= '
-                                               <noscript>' . LF . '<object class="audio-flash-fallback" id="' . $replaceElementIdString . '_audio_flash" type="application/x-shockwave-flash" data="' . $player . '" width="' . $width . '" height="' . $height . '">' . LF . $audioFlashParams . LF . $alternativeContent . LF . '</object>' . LF . '</noscript>';
-                               }
-                               $divContent = ($conf['type'] === 'video' ? '' : '<div id="' . $replaceElementIdString . '_flash_install_info" class="flash-install-info"></div>' . LF) . '<audio id="' . $replaceElementIdString . '_audio_element" class="audio-element"' . $attributes . ($conf['type'] === 'video' ? ' mediagroup="' . $replaceElementIdString . '" style="position:absolute;left:-10000px;"' : ' controls="controls"') . '>' . LF . $audioTagContent . '</audio>' . LF . $audioSourcesEmbeddingJsScript;
-                               $audioContent = '<div id="' . $replaceElementIdString . '_audio_box" class="audio-box" style="width:' . ($conf['type'] === 'video' ? 0 : $width) . 'px; height:' . ($conf['type'] === 'video' ? 0 : $height) . 'px;">' . LF . $divContent . '</div>';
-                       }
-                       if ($conf['type'] === 'audio') {
-                               $content = str_replace('###SWFOBJECT###', $audioContent, $content);
-                       } else {
-                               $content .= LF . $audioContent;
-                       }
-               }
-               // Assemble inline JS code
-               $videoJsSetup = '';
-               $flowplayerHandlers = '';
-               if ($conf['type'] === 'video') {
-                       // Assemble videoJS options
-                       $videoJsOptions = array();
-                       foreach ($this->videoJsOptions as $videoJsOption) {
-                               if (isset($conf['params.'][$videoJsOption])) {
-                                       $videoJsOptions[$videoJsOption] = $conf['params.'][$videoJsOption];
-                               }
-                       }
-                       $videoJsOptions = count($videoJsOptions) ? json_encode($videoJsOptions) : '{}';
-                       // videoJS setup and videoJS listeners for audio description synchronisation
-                       if ($audioSources || isset($conf['audioFallback'])) {
-                               $videoJsSetup = '
-                       var ' . $replaceElementIdString . '_video = VideoJS.setup("' . $replaceElementIdString . '_video_js", ' . $videoJsOptions . ');
-                       var ' . $replaceElementIdString . '_video_element = document.getElementById("' . $replaceElementIdString . '_video_js");
-                       var ' . $replaceElementIdString . '_audio_element = document.getElementById("' . $replaceElementIdString . '_audio_element");
-                       if (!!' . $replaceElementIdString . '_video_element && !!' . $replaceElementIdString . '_audio_element) {
-                               ' . $replaceElementIdString . '_audio_element.muted = true;
-                               VideoJS.addListener(' . $replaceElementIdString . '_video_element, "pause", function () { document.getElementById("' . $replaceElementIdString . '_audio_element").pause(); });
-                               VideoJS.addListener(' . $replaceElementIdString . '_video_element, "play", function () { try {document.getElementById("' . $replaceElementIdString . '_audio_element").currentTime = document.getElementById("' . $replaceElementIdString . '_video_js").currentTime} catch(e) {}; document.getElementById("' . $replaceElementIdString . '_audio_element").play(); });
-                               VideoJS.addListener(' . $replaceElementIdString . '_video_element, "seeked", function () { document.getElementById("' . $replaceElementIdString . '_audio_element").currentTime = document.getElementById("' . $replaceElementIdString . '_video_js").currentTime; });
-                               VideoJS.addListener(' . $replaceElementIdString . '_video_element, "volumechange", function () { document.getElementById("' . $replaceElementIdString . '_audio_element").volume = document.getElementById("' . $replaceElementIdString . '_video_js").volume; });
-                       }';
-                       } else {
-                               $videoJsSetup = '
-                       var ' . $replaceElementIdString . '_video = VideoJS.setup("' . $replaceElementIdString . '_video_js", ' . $videoJsOptions . ');
-                       ';
-                       }
-                       // Prefer Flash or fallback to Flash
-                       $videoSourcesEmbedding = '';
-                       // If we have a video file for Flash
-                       if (isset($conf['filename'])) {
-                               // If we prefer Flash
-                               if ($conf['preferFlashOverHtml5']) {
-                                       $videoTagAssembly = '';
-                                       // Create "source" elements
-                                       if (is_array($conf['sources']) && count($conf['sources'])) {
-                                               foreach ($conf['sources'] as $source) {
-                                                       $fileinfo = \TYPO3\CMS\Core\Utility\GeneralUtility::split_fileref($source);
-                                                       $mimeType = $this->mimeTypes[$fileinfo['fileext']]['video'];
-                                                       $videoTagAssembly .= '
-                       ' . $replaceElementIdString . '_video_js.appendChild($f.extend(document.createElement("source"), {
-                               src: "' . $source . '",
-                               type: "' . $mimeType . '"
-                       }));';
-                                               }
-                                               // Create "track" elements
-                                               if (isset($conf['caption'])) {
-                                                       // Assemble captions track tag
-                                                       // It will take a while before the captions are loaded and parsed...
-                                                       $videoTagAssembly .= '
-                       var track  = document.createElement("track");
-                       track.setAttribute("src", "' . $conf['caption'] . '");
-                       track.setAttribute("id", "' . $replaceElementIdString . '_captions_track");
-                       track.setAttribute("kind", "captions");
-                       ' . $replaceElementIdString . '_video_js.appendChild(track);';
-                                               }
-                                               $videoTagAssembly .= '
-                       $f.extend(' . $replaceElementIdString . '_video_js, {
-                               id: "' . $replaceElementIdString . '_video_js",
-                               className: "video-js",
-                               controls: "controls",
-                               mediagroup: "' . $replaceElementIdString . '",
-                               preload: "none",
-                               width: "' . $width . '",
-                               height: "' . $height . '"
-                       });
-                       ' . $replaceElementIdString . '_video.appendChild(' . $replaceElementIdString . '_video_js);
-                       ' . $replaceElementIdString . '_video.className = "video-js-box";';
-                                               $videoTagAssembly .= $videoJsSetup;
-                                       }
-                                       $videoSourcesEmbedding = '
-               var ' . $replaceElementIdString . '_video = document.getElementById("' . $replaceElementIdString . '_video");
-               var ' . $replaceElementIdString . '_video_js = document.createElement("video");
-               if (flashembed.getVersion()[0] > 0) {
-                               // Flash is available
-                       var videoPlayer = flowplayer("' . $replaceElementIdString . '_video", ' . $flashConfiguration . ', ' . $flowplayerVideoJsonConfig . ').load();
-                       videoPlayer.onBeforeUnload(function () { return false; });
-               } else if (!!' . $replaceElementIdString . '_video_js.canPlayType) {
-                               // Flash is not available: fallback to videoJS if video tag is supported
-                       ' . $videoTagAssembly . '
-               } else {
-                               // Neither Flash nor video is available: offer to install Flash
-                       flashembed("' . $replaceElementIdString . '_video", ' . $flashConfiguration . ');
-               }';
-                               } elseif (is_array($conf['sources'])) {
-                                       // HTML5 is the preferred rendering method
-                                       // Test whether the browser supports any of types of the provided sources
-                                       $supported = array();
-                                       foreach ($conf['sources'] as $source) {
-                                               $fileinfo = \TYPO3\CMS\Core\Utility\GeneralUtility::split_fileref($source);
-                                               $mimeType = $this->mimeTypes[$fileinfo['fileext']]['video'];
-                                               $supported[] = $replaceElementIdString . '_videoTag.canPlayType("' . $mimeType . '") != ""';
-                                       }
-                                       // Testing whether the browser supports the video tag with any of the provided source types
-                                       // If no support, embed flowplayer
-                                       $videoSourcesEmbedding = '
-               var ' . $replaceElementIdString . '_videoTag = document.createElement(\'video\');
-               var ' . $replaceElementIdString . '_video_box = document.getElementById("' . $replaceElementIdString . '_video");
-               if (' . $replaceElementIdString . '_video_box) {
-                       if (!' . $replaceElementIdString . '_videoTag || !' . $replaceElementIdString . '_videoTag.canPlayType || !(' . (count($supported) ? implode(' || ', $supported) : 'false') . ')) {
-                                       // Avoid showing an empty video element
-                               if (document.getElementById("' . $replaceElementIdString . '_video_js")) {
-                                       document.getElementById("' . $replaceElementIdString . '_video_js").style.display = "none";
-                               }
-                               if (flashembed.getVersion()[0] > 0) {
-                                               // Flash is available
-                                       var videoPlayer = flowplayer("' . $replaceElementIdString . '_video", ' . $flashConfiguration . ', ' . $flowplayerVideoJsonConfig . ').load();
-                                       videoPlayer.onBeforeUnload(function () { return false; });
-                               } else {
-                                               // Neither Flash nor video is available: offer to install Flash
-                                       flashembed("' . $replaceElementIdString . '_video", ' . $flashConfiguration . ');
-                               }
-                       } else {' . $videoJsSetup . '
-                       }
-               }';
-                               }
-                       }
-               }
-               // Audio fallback to Flash
-               $audioSourcesEmbedding = '';
-               // If we have an audio file for Flash
-               if (isset($conf['audioFallback'])) {
-                       // If we prefer Flash in
-                       if ($conf['preferFlashOverHtml5']) {
-                               $audioTagAssembly = '';
-                               // Create "source" elements
-                               if (is_array($conf['audioSources']) && count($conf['audioSources'])) {
-                                       foreach ($conf['audioSources'] as $source) {
-                                               $fileinfo = \TYPO3\CMS\Core\Utility\GeneralUtility::split_fileref($source);
-                                               $mimeType = $this->mimeTypes[$fileinfo['fileext']]['audio'];
-                                               $audioTagAssembly .= '
-               ' . $replaceElementIdString . '_audio_element.appendChild($f.extend(document.createElement("source"), {
-                       src: "' . $source . '",
-                       type: "' . $mimeType . '"
-               }));';
-                                       }
-                                       $audioTagAssembly .= '
-               $f.extend(' . $replaceElementIdString . '_audio_element, {
-                       id: "' . $replaceElementIdString . '_audio_element",
-                       className: "audio-element",
-                       controls: "' . ($conf['type'] === 'video' ? '' : 'controls') . '",
-                       mediagroup: "' . $replaceElementIdString . '",
-                       preload: "none",
-                       width: "' . ($conf['type'] === 'video' ? 0 : $width) . 'px",
-                       height: "' . ($conf['type'] === 'video' ? 0 : $height) . 'px"
-               });
-               ' . $replaceElementIdString . '_audio_box.appendChild(' . $replaceElementIdString . '_audio_element);
-               ' . $replaceElementIdString . '_audio_box.className = "audio-box";';
-                               }
-                               $audioSourcesEmbedding = '
-               var ' . $replaceElementIdString . '_audio_box = document.getElementById("' . $replaceElementIdString . '_audio_box");
-               var ' . $replaceElementIdString . '_audio_element = document.createElement("audio");
-               if (flashembed.getVersion()[0] > 0) {
-                               // Flash is available
-                       var audioPlayer = flowplayer("' . $replaceElementIdString . '_audio_box", ' . $flashConfiguration . ', ' . $flowplayerAudioJsonConfig . ').load();
-                       audioPlayer.onBeforeUnload(function () { return false; });
-                       ' . ($conf['type'] === 'video' ? 'audioPlayer.mute();' : '') . '
-               } else if (!!' . $replaceElementIdString . '_audio_element.canPlayType) {
-                               // Flash is not available: fallback to audio element if audio tag is supported
-                       ' . $audioTagAssembly . '
-               } else {
-                               // Neither Flash nor audio is available: offer to install Flash if this is not an audio description of a video
-                       ' . ($conf['type'] === 'video' ? '' : 'flashembed("' . $replaceElementIdString . '_audio_box", ' . $flashConfiguration . ');') . '
-               }';
-                       } elseif (is_array($conf['audioSources'])) {
-                               // HTML5 is the preferred rendering method
-                               // Test whether the browser supports any of types of the provided sources
-                               $supported = array();
-                               foreach ($conf['audioSources'] as $source) {
-                                       $fileinfo = \TYPO3\CMS\Core\Utility\GeneralUtility::split_fileref($source);
-                                       $mimeType = $this->mimeTypes[$fileinfo['fileext']]['audio'];
-                                       $supported[] = $replaceElementIdString . '_audioTag.canPlayType("' . $mimeType . '") != ""';
-                               }
-                               // Testing whether the browser supports the audio tag with any of the provided source types
-                               // If no support, embed flowplayer
-                               $audioSourcesEmbedding = '
-               var ' . $replaceElementIdString . '_audioTag = document.createElement(\'audio\');
-               var ' . $replaceElementIdString . '_audio_box = document.getElementById("' . $replaceElementIdString . '_audio_box");
-               if (' . $replaceElementIdString . '_audio_box) {
-                       if (!' . $replaceElementIdString . '_audioTag || !' . $replaceElementIdString . '_audioTag.canPlayType || !(' . (count($supported) ? implode(' || ', $supported) : 'false') . ')) {
-                                       // Avoid showing an empty audio element
-                               if (document.getElementById("' . $replaceElementIdString . '_audio_element")) {
-                                       document.getElementById("' . $replaceElementIdString . '_audio_element").style.display = "none";
-                               }
-                               if (flashembed.getVersion()[0] > 0) {
-                                       var audioPlayer = flowplayer("' . $replaceElementIdString . '_audio_box", ' . $flashConfiguration . ', ' . $flowplayerAudioJsonConfig . ').load();
-                                       audioPlayer.onBeforeUnload(function () { return false; });
-                                       ' . ($conf['type'] === 'video' ? 'audioPlayer.mute()' : '') . '
-                               } else {
-                                               // Neither Flash nor audio is available: offer to install Flash if this is not an audio description of a video
-                                       ' . ($conf['type'] === 'video' ? '' : 'flashembed("' . $replaceElementIdString . '_audio_box", ' . $flashConfiguration . ');') . '
-                               }
-                       }
-               }';
-                       }
-                       // Flowplayer eventHandlers for audio description synchronisation
-                       $flowplayerHandlers = '';
-                       if ($conf['type'] === 'video') {
-                               $flowplayerHandlers = '
-               if (flashembed.getVersion()[0] > 0) {
-                               // Flash is available
-                       var videoPlayer = flowplayer("' . $replaceElementIdString . '_video");
-                       if (videoPlayer) {
-                                       // Control audio description through video control bar
-                               videoPlayer.onVolume(function (volume) { flowplayer("' . $replaceElementIdString . '_audio_box").setVolume(volume); });
-                               videoPlayer.onMute(function () { flowplayer("' . $replaceElementIdString . '_audio_box").mute(); });
-                               videoPlayer.onUnmute(function () { flowplayer("' . $replaceElementIdString . '_audio_box").unmute(); });
-                               videoPlayer.onPause(function () { flowplayer("' . $replaceElementIdString . '_audio_box").pause(); });
-                               videoPlayer.onResume(function () { flowplayer("' . $replaceElementIdString . '_audio_box").resume(); });
-                               videoPlayer.onStart(function () { flowplayer("' . $replaceElementIdString . '_audio_box").play(); });
-                               videoPlayer.onStop(function () { flowplayer("' . $replaceElementIdString . '_audio_box").stop(); });
-                               videoPlayer.onSeek(function (clip, seconds) { flowplayer("' . $replaceElementIdString . '_audio_box").seek(seconds); });
-                                       // Mute audio description on start
-                               flowplayer("' . $replaceElementIdString . '_audio_box").onStart(function () { this.mute()});
-                                       // Audio description toggle
-                               var videoContainer = document.getElementById("' . $replaceElementIdString . '_video");
-                               var buttonContainer = document.createElement("div");
-                               $f.extend(buttonContainer, {
-                                       id: "' . $replaceElementIdString . '_audio_description_toggle",
-                                       className: "vjs-audio-description-control"
-                               });
-                               var button = document.createElement("div");
-                               buttonContainer.appendChild(button);
-                               buttonContainer.style.position = "relative";
-                               buttonContainer.style.left = (parseInt(' . $width . ', 10)-27) + "px";
-                               videoContainer.parentNode.insertBefore(buttonContainer, videoContainer.nextSibling);
-                               VideoJS.addListener(buttonContainer, "click", function () {
-                                       var buttonContainer = document.getElementById("' . $replaceElementIdString . '_audio_description_toggle");
-                                       var state = buttonContainer.getAttribute("data-state");
-                                       if (state == "enabled") {
-                                               buttonContainer.setAttribute("data-state", "disabled");
-                                               flowplayer("' . $replaceElementIdString . '_audio_box").mute();
-                                       } else {
-                                               buttonContainer.setAttribute("data-state", "enabled");
-                                               flowplayer("' . $replaceElementIdString . '_audio_box").unmute();
-                                       }
-                               });
-                       }
-               }';
-                       }
-               }
-               // Wrap up inline JS code
-               $jsInlineCode = $audioSourcesEmbedding . $videoSourcesEmbedding . $flowplayerHandlers;
-               if ($jsInlineCode) {
-                       $jsInlineCode = 'VideoJS.DOMReady(function(){' . $jsInlineCode . LF . '});';
-               }
-               $pageRenderer->addJsInlineCode($replaceElementIdString, $jsInlineCode);
-               if (isset($conf['stdWrap.'])) {
-                       $content = $this->cObj->stdWrap($content, $conf['stdWrap.']);
-               }
-               return $content;
-       }
-
-}
diff --git a/typo3/sysext/frontend/Classes/ContentObject/MediaContentObject.php b/typo3/sysext/frontend/Classes/ContentObject/MediaContentObject.php
deleted file mode 100644 (file)
index 8317006..0000000
+++ /dev/null
@@ -1,299 +0,0 @@
-<?php
-namespace TYPO3\CMS\Frontend\ContentObject;
-
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-/**
- * Contains MEDIA class object.
- *
- * @author Xavier Perseguers <typo3@perseguers.ch>
- * @author Steffen Kamper <steffen@typo3.org>
- */
-class MediaContentObject extends AbstractContentObject {
-
-       /**
-        * Rendering the cObject, MEDIA
-        *
-        * @param array $conf Array of TypoScript properties
-        * @return string Output
-        */
-       public function render($conf = array()) {
-               $content = '';
-               // Add flex parameters to configuration
-               $flexParams = isset($conf['flexParams.']) ? $this->cObj->stdWrap($conf['flexParams'], $conf['flexParams.']) : $conf['flexParams'];
-               if ($flexParams[0] === '<') {
-                       // It is a content element rather a TS object
-                       $flexParams = \TYPO3\CMS\Core\Utility\GeneralUtility::xml2array($flexParams, 'T3');
-                       foreach ($flexParams['data'] as $sheetData) {
-                               $this->cObj->readFlexformIntoConf($sheetData['lDEF'], $conf['parameter.'], TRUE);
-                       }
-               }
-               // Type is video or audio
-               $conf['type'] = $this->doFlexFormOverlay($conf, 'type');
-               // Video sources
-               $sources = $this->doFlexFormOverlay($conf, 'sources', 'mmSourcesContainer');
-               if (is_array($sources) && count($sources)) {
-                       $conf['sources'] = array();
-                       foreach ($sources as $key => $source) {
-                               if (isset($source['mmSource'])) {
-                                       $source = $source['mmSource'];
-                                       $conf['sources'][$key] = $this->retrieveMediaUrl($source);
-                               }
-                       }
-               } else {
-                       unset($conf['sources']);
-               }
-               // Video fallback and backward compatibility file
-               $videoFallback = $this->doFlexFormOverlay($conf, 'file');
-
-               // Backward compatibility file
-               if ($videoFallback !== NULL) {
-                       $conf['file'] = $this->retrieveMediaUrl($videoFallback);
-               } else {
-                       unset($conf['file']);
-               }
-               // Audio sources
-               $audioSources = $this->doFlexFormOverlay($conf, 'audioSources', 'mmAudioSourcesContainer');
-               if (is_array($audioSources) && count($audioSources)) {
-                       $conf['audioSources'] = array();
-                       foreach ($audioSources as $key => $source) {
-                               if (isset($source['mmAudioSource'])) {
-                                       $source = $source['mmAudioSource'];
-                                       $conf['audioSources'][$key] = $this->retrieveMediaUrl($source);
-                               }
-                       }
-               } else {
-                       unset($conf['audioSources']);
-               }
-               // Audio fallback
-               $audioFallback = $this->doFlexFormOverlay($conf, 'audioFallback');
-               if ($audioFallback) {
-                       $conf['audioFallback'] = $this->retrieveMediaUrl($audioFallback);
-               } else {
-                       unset($conf['audioFallback']);
-               }
-               // Caption file
-               $caption = $this->doFlexFormOverlay($conf, 'caption');
-               if ($caption) {
-                       $conf['caption'] = $this->retrieveMediaUrl($caption);
-               } else {
-                       unset($conf['caption']);
-               }
-               // Establish render type
-               $renderType = $this->doFlexFormOverlay($conf, 'renderType');
-               $conf['preferFlashOverHtml5'] = 0;
-               if ($renderType === 'preferFlashOverHtml5') {
-                       $renderType = 'auto';
-               }
-               if ($renderType === 'auto') {
-                       // Default renderType is swf
-                       $renderType = 'swf';
-                       $handler = array_keys($conf['fileExtHandler.']);
-                       if ($conf['type'] === 'video') {
-                               $fileinfo = \TYPO3\CMS\Core\Utility\GeneralUtility::split_fileref($conf['file']);
-                       } else {
-                               $fileinfo = \TYPO3\CMS\Core\Utility\GeneralUtility::split_fileref($conf['audioFallback']);
-                       }
-                       if (in_array($fileinfo['fileext'], $handler)) {
-                               $renderType = strtolower($conf['fileExtHandler.'][$fileinfo['fileext']]);
-                       }
-               }
-               $mime = $renderType . 'object';
-               $typeConf = $conf['mimeConf.'][$mime . '.'][$conf['type'] . '.'] ?: array();
-               $conf['predefined'] = array();
-               // Width and height
-               $conf['width'] = (int)$this->doFlexFormOverlay($conf, 'width');
-               $conf['height'] = (int)$this->doFlexFormOverlay($conf, 'height');
-               if (is_array($conf['parameter.']['mmMediaOptions'])) {
-                       foreach ($conf['parameter.']['mmMediaOptions'] as $key => $value) {
-                               if ($key == 'mmMediaCustomParameterContainer') {
-                                       foreach ($value as $val) {
-                                               // Custom parameter entry
-                                               $rawTS = $val['mmParamCustomEntry'];
-                                               // Read and merge
-                                               $tmp = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(LF, $rawTS);
-                                               if (count($tmp)) {
-                                                       foreach ($tmp as $tsLine) {
-                                                               if ($tsLine[0] !== '#' && ($pos = strpos($tsLine, '.'))) {
-                                                                       $parts[0] = substr($tsLine, 0, $pos);
-                                                                       $parts[1] = substr($tsLine, $pos + 1);
-                                                                       $valueParts = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode('=', $parts[1], TRUE);
-                                                                       switch (strtolower($parts[0])) {
-                                                                               case 'flashvars':
-                                                                                       $conf['flashvars.'][$valueParts[0]] = $valueParts[1];
-                                                                                       break;
-                                                                               case 'params':
-                                                                                       $conf['params.'][$valueParts[0]] = $valueParts[1];
-                                                                                       break;
-                                                                               case 'attributes':
-                                                                                       $conf['attributes.'][$valueParts[0]] = $valueParts[1];
-                                                                                       break;
-                                                                       }
-                                                               }
-                                                       }
-                                               }
-                                       }
-                               } elseif ($key == 'mmMediaOptionsContainer') {
-                                       foreach ($value as $val) {
-                                               if (isset($val['mmParamSet'])) {
-                                                       $pName = $val['mmParamName'];
-                                                       $pSet = $val['mmParamSet'];
-                                                       $pValue = $pSet == 2 ? $val['mmParamValue'] : ($pSet == 0 ? 'false' : 'true');
-                                                       $conf['predefined'][$pName] = $pValue;
-                                               }
-                                       }
-                               }
-                       }
-               }
-               if ($renderType === 'swf' && $this->doFlexFormOverlay($conf, 'useHTML5')) {
-                       $renderType = 'flowplayer';
-               }
-               if ($conf['type'] === 'audio' && !isset($conf['audioSources'])) {
-                       $renderType = 'swf';
-               }
-               if ($renderType !== 'qt' && $renderType !== 'embed' && $conf['type'] == 'video') {
-                       if (isset($conf['file']) && (strpos($conf['file'], '.swf') !== FALSE || strpos($conf['file'], '://') !== FALSE && strpos(\TYPO3\CMS\Core\Utility\GeneralUtility::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']) && strpos($conf['file'], '://') !== FALSE) {
-                               $mediaWizard = \TYPO3\CMS\Frontend\MediaWizard\MediaWizardProviderManager::getValidMediaWizardProvider($conf['file']);
-                               if ($mediaWizard !== NULL) {
-                                       $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->cObjGetSingle('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->cObjGetSingle('SWFOBJECT', $conf);
-                               break;
-                       case 'qt':
-                               $conf[$conf['type'] . '.'] = array_merge($conf['mimeConf.']['swfobject.'][$conf['type'] . '.'], $typeConf);
-                               $conf = array_merge($conf['mimeConf.']['qtobject.'], $conf);
-                               unset($conf['mimeConf.']);
-                               $conf['params.'] = array_merge((array)$conf['params.'], $conf['predefined']);
-                               $content = $this->cObj->cObjGetSingle('QTOBJECT', $conf);
-                               break;
-                       case 'embed':
-                               $paramsArray = array_merge((array)$typeConf['default.']['params.'], (array)$conf['params.'], $conf['predefined']);
-                               $conf['params'] = '';
-                               foreach ($paramsArray as $key => $value) {
-                                       $conf['params'] .= $key . '=' . $value . LF;
-                               }
-                               $content = $this->cObj->cObjGetSingle('MULTIMEDIA', $conf);
-                               break;
-                       default:
-                               if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/hooks/class.tx_cms_mediaitems.php']['customMediaRender'])) {
-                                       foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/hooks/class.tx_cms_mediaitems.php']['customMediaRender'] as $classRef) {
-                                               $hookObj = \TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($classRef);
-                                               $conf['file'] = $videoFallback;
-                                               $conf['mode'] = is_file(PATH_site . $videoFallback) ? 'file' : 'url';
-                                               if (method_exists($hookObj, 'customMediaRender')) {
-                                                       $content = $hookObj->customMediaRender($renderType, $conf, $this);
-                                               }
-                                       }
-                               }
-                               if (isset($conf['stdWrap.'])) {
-                                       $content = $this->cObj->stdWrap($content, $conf['stdWrap.']);
-                               }
-               }
-               return $content;
-       }
-
-       /**
-        * Resolves the URL of an file
-        *
-        * @param string $file
-        * @return string|NULL
-        */
-       protected function retrieveMediaUrl($file) {
-               $returnValue = NULL;
-
-               // because the file value can possibly have link parameters, use explode to split all values
-               $fileParts = explode(' ', $file);
-
-               /** @var $mediaWizard \TYPO3\CMS\Frontend\MediaWizard\MediaWizardProviderInterface */
-               $mediaWizard = \TYPO3\CMS\Frontend\MediaWizard\MediaWizardProviderManager::getValidMediaWizardProvider($fileParts[0]);
-               // Get the path relative to the page currently outputted
-               if (substr($fileParts[0], 0, 5) === 'file:') {
-                       $fileUid = substr($fileParts[0], 5);
-
-                       if (!empty($fileUid) && \TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($fileUid)) {
-                               $fileObject = \TYPO3\CMS\Core\Resource\ResourceFactory::getInstance()->getFileObject($fileUid);
-
-                               if ($fileObject instanceof \TYPO3\CMS\Core\Resource\FileInterface) {
-                                       $returnValue = $fileObject->getPublicUrl();
-                               }
-                       }
-               } elseif (is_file(PATH_site . $fileParts[0])) {
-                       $returnValue = $GLOBALS['TSFE']->tmpl->getFileName($fileParts[0]);
-               } elseif ($mediaWizard !== NULL) {
-                       $jumpUrlEnabled = $GLOBALS['TSFE']->config['config']['jumpurl_enable'];
-                       $GLOBALS['TSFE']->config['config']['jumpurl_enable'] = 0;
-                       $returnValue = $this->cObj->typoLink_URL(array(
-                               'parameter' => $mediaWizard->rewriteUrl($fileParts[0])
-                       ));
-                       $GLOBALS['TSFE']->config['config']['jumpurl_enable'] = $jumpUrlEnabled;
-               } elseif (\TYPO3\CMS\Core\Utility\GeneralUtility::isValidUrl($fileParts[0])) {
-                       $returnValue = $fileParts[0];
-               }
-
-               return $returnValue;
-       }
-
-       /**
-        * Looks up if the key is set via flexform and returns the actual value.
-        * If not present in flexform, it processes the value which might be given in TS
-        * with stdWrap (if needed) and returns that value.
-        *
-        * @param array &$confArray
-        * @param string $key
-        * @param string $sectionKey
-        * @return mixed
-        */
-       protected function doFlexFormOverlay(array &$confArray, $key, $sectionKey = NULL) {
-               $flexValue = NULL;
-               $flexKey = 'mm' . ucfirst($key);
-               if ($sectionKey === NULL) {
-                       $flexValue = $confArray['parameter.'][$flexKey];
-               } else {
-                       $flexValue = $confArray['parameter.'][$flexKey][$sectionKey];
-               }
-               if ($flexValue === NULL) {
-                       $flexValue = isset($confArray[$key . '.']) ? $this->cObj->stdWrap($confArray[$key], $confArray[$key . '.']) : $confArray[$key];
-               }
-               return $flexValue;
-       }
-
-}
diff --git a/typo3/sysext/frontend/Classes/ContentObject/MultimediaContentObject.php b/typo3/sysext/frontend/Classes/ContentObject/MultimediaContentObject.php
deleted file mode 100644 (file)
index 97f45ef..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-<?php
-namespace TYPO3\CMS\Frontend\ContentObject;
-
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-/**
- * Contains MULTIMEDIA class object.
- *
- * @author Xavier Perseguers <typo3@perseguers.ch>
- * @author Steffen Kamper <steffen@typo3.org>
- */
-class MultimediaContentObject extends AbstractContentObject {
-
-       /**
-        * Rendering the cObject, MULTIMEDIA
-        *
-        * @param array $conf Array of TypoScript properties
-        * @return string Output
-        */
-       public function render($conf = array()) {
-               $content = '';
-               $filename = isset($conf['file.']) ? $this->cObj->stdWrap($conf['file'], $conf['file.']) : $conf['file'];
-               $incFile = $GLOBALS['TSFE']->tmpl->getFileName($filename);
-               if ($incFile) {
-                       $fileinfo = \TYPO3\CMS\Core\Utility\GeneralUtility::split_fileref($incFile);
-                       if (\TYPO3\CMS\Core\Utility\GeneralUtility::inList('txt,html,htm', $fileinfo['fileext'])) {
-                               $content = $GLOBALS['TSFE']->tmpl->fileContent($incFile);
-                       } else {
-                               // Default params...
-                               $parArray = array();
-                               // Src is added
-                               $width = isset($conf['width.']) ? $this->cObj->stdWrap($conf['width'], $conf['width.']) : $conf['width'];
-                               if (!$width) {
-                                       $width = 200;
-                               }
-                               $height = isset($conf['height.']) ? $this->cObj->stdWrap($conf['height'], $conf['height.']) : $conf['height'];
-                               if (!$height) {
-                                       $height = 200;
-                               }
-                               $parArray['src'] = 'src="' . $GLOBALS['TSFE']->absRefPrefix . $incFile . '"';
-                               if (\TYPO3\CMS\Core\Utility\GeneralUtility::inList('au,wav,mp3', $fileinfo['fileext'])) {
-
-                               }
-                               if (\TYPO3\CMS\Core\Utility\GeneralUtility::inList('avi,mov,mpg,asf,wmv', $fileinfo['fileext'])) {
-                                       $parArray['width'] = 'width="' . $width . '"';
-                                       $parArray['height'] = 'height="' . $height . '"';
-                               }
-                               if (\TYPO3\CMS\Core\Utility\GeneralUtility::inList('swf,swa,dcr', $fileinfo['fileext'])) {
-                                       $parArray['quality'] = 'quality="high"';
-                                       $parArray['width'] = 'width="' . $width . '"';
-                                       $parArray['height'] = 'height="' . $height . '"';
-                               }
-                               if (\TYPO3\CMS\Core\Utility\GeneralUtility::inList('class', $fileinfo['fileext'])) {
-                                       $parArray['width'] = 'width="' . $width . '"';
-                                       $parArray['height'] = 'height="' . $height . '"';
-                               }
-                               // fetching params
-                               $params = isset($conf['params.']) ? $this->cObj->stdWrap($conf['params'], $conf['params.']) : $conf['params'];
-                               $lines = explode(LF, $params);
-                               foreach ($lines as $l) {
-                                       $parts = explode('=', $l);
-                                       $parameter = strtolower(trim($parts[0]));
-                                       $value = trim($parts[1]);
-                                       if ((string)$value != '') {
-                                               $parArray[$parameter] = $parameter . '="' . htmlspecialchars($value) . '"';
-                                       } else {
-                                               unset($parArray[$parameter]);
-                                       }
-                               }
-                               if ($fileinfo['fileext'] == 'class') {
-                                       unset($parArray['src']);
-                                       $parArray['code'] = 'code="' . htmlspecialchars($fileinfo['file']) . '"';
-                                       $parArray['codebase'] = 'codebase="' . htmlspecialchars($fileinfo['path']) . '"';
-                                       $content = '<applet ' . implode(' ', $parArray) . '></applet>';
-                               } else {
-                                       $content = '<embed ' . implode(' ', $parArray) . '></embed>';
-                               }
-                       }
-               }
-               if (isset($conf['stdWrap.'])) {
-                       $content = $this->cObj->stdWrap($content, $conf['stdWrap.']);
-               }
-               return $content;
-       }
-
-}
diff --git a/typo3/sysext/frontend/Classes/ContentObject/QuicktimeObjectContentObject.php b/typo3/sysext/frontend/Classes/ContentObject/QuicktimeObjectContentObject.php
deleted file mode 100644 (file)
index d3dcec6..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-<?php
-namespace TYPO3\CMS\Frontend\ContentObject;
-
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-use TYPO3\CMS\Core\Utility\ArrayUtility;
-
-/**
- * Contains QTOBJECT class object.
- *
- * @author Xavier Perseguers <typo3@perseguers.ch>
- * @author Steffen Kamper <steffen@typo3.org>
- */
-class QuicktimeObjectContentObject extends AbstractContentObject {
-
-       /**
-        * Rendering the cObject, QTOBJECT
-        *
-        * @param array $conf Array of TypoScript properties
-        * @return string Output
-        */
-       public function render($conf = array()) {
-               $params = ($prefix = '');
-               if ($GLOBALS['TSFE']->baseUrl) {
-                       $prefix = $GLOBALS['TSFE']->baseUrl;
-               }
-               if ($GLOBALS['TSFE']->absRefPrefix) {
-                       $prefix = $GLOBALS['TSFE']->absRefPrefix;
-               }
-               $type = isset($conf['type.']) ? $this->cObj->stdWrap($conf['type'], $conf['type.']) : $conf['type'];
-
-               // If file is audio and an explicit path has not been set,
-               // take path from audio fallback property
-               if ($type == 'audio' && empty($conf['file'])) {
-                       $conf['file'] = $conf['audioFallback'];
-               }
-               $filename = isset( $conf['file.'])
-                       ? $this->cObj->stdWrap($conf['file'], $conf['file.'])
-                       : $conf['file'];
-
-               $typeConf = $conf[$type . '.'];
-               // Add QTobject js-file
-               $GLOBALS['TSFE']->getPageRenderer()->addJsFile(TYPO3_mainDir . 'contrib/flashmedia/qtobject/qtobject.js');
-               $replaceElementIdString = str_replace('.', '', uniqid('mmqt', TRUE));
-               $GLOBALS['TSFE']->register['MMQTID'] = $replaceElementIdString;
-               $qtObject = 'QTObject' . $replaceElementIdString;
-               // Merge with default parameters
-               $conf['params.'] = array_merge((array)$typeConf['default.']['params.'], (array)$conf['params.']);
-               if (is_array($conf['params.'])) {
-                       ArrayUtility::remapArrayKeys($conf['params.'], $typeConf['mapping.']['params.']);
-                       foreach ($conf['params.'] as $key => $value) {
-                               $params .= $qtObject . '.addParam("' . $key . '", "' . $value . '");' . LF;
-                       }
-               }
-               $params = ($params ? substr($params, 0, -2) : '') . LF . $qtObject . '.write("' . $replaceElementIdString . '");';
-               $alternativeContent = isset($conf['alternativeContent.']) ? $this->cObj->stdWrap($conf['alternativeContent'], $conf['alternativeContent.']) : $conf['alternativeContent'];
-               $layout = str_replace(
-                       array(
-                               '###ID###',
-                               '###QTOBJECT###'
-                       ),
-                       array(
-                               $replaceElementIdString,
-                               '<div id="' . $replaceElementIdString . '">' . $alternativeContent . '</div>'
-                       ),
-                       isset($conf['layout.']) ? $this->cObj->stdWrap($conf['layout'], $conf['layout.']) : $conf['layout']
-               );
-               $width = isset($conf['width.']) ? $this->cObj->stdWrap($conf['width'], $conf['width.']) : $conf['width'];
-               if (!$width) {
-                       $width = $conf[$type . '.']['defaultWidth'];
-               }
-               $height = isset($conf['height.']) ? $this->cObj->stdWrap($conf['height'], $conf['height.']) : $conf['height'];
-               if (!$height) {
-                       $height = $conf[$type . '.']['defaultHeight'];
-               }
-               $fullFilename = $filename;
-               // If the file name doesn't contain a scheme, prefix with appropriate data
-               if (strpos($filename, '://') === FALSE && !empty($prefix)) {
-                       $fullFilename = $prefix . $filename;
-               }
-               $embed = 'var ' . $qtObject . ' = new QTObject("' . $fullFilename . '", "' . $replaceElementIdString . '", "' . $width . '", "' . $height . '");';
-               $content = $layout . '
-                       <script type="text/javascript">
-                               ' . $embed . '
-                               ' . $params . '
-                       </script>';
-               if (isset($conf['stdWrap.'])) {
-                       $content = $this->cObj->stdWrap($content, $conf['stdWrap.']);
-               }
-               return $content;
-       }
-
-}
diff --git a/typo3/sysext/frontend/Classes/ContentObject/ShockwaveFlashObjectContentObject.php b/typo3/sysext/frontend/Classes/ContentObject/ShockwaveFlashObjectContentObject.php
deleted file mode 100644 (file)
index 8ba8df1..0000000
+++ /dev/null
@@ -1,129 +0,0 @@
-<?php
-namespace TYPO3\CMS\Frontend\ContentObject;
-
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-use TYPO3\CMS\Core\Utility\ArrayUtility;
-
-/**
- * Contains SWFOBJECT class object.
- *
- * @author Xavier Perseguers <typo3@perseguers.ch>
- * @author Steffen Kamper <steffen@typo3.org>
- */
-class ShockwaveFlashObjectContentObject extends AbstractContentObject {
-
-       /**
-        * Rendering the cObject, SWFOBJECT
-        *
-        * @param array $conf Array of TypoScript properties
-        * @return string Output
-        */
-       public function render($conf = array()) {
-               $prefix = '';
-               if ($GLOBALS['TSFE']->baseUrl) {
-                       $prefix = $GLOBALS['TSFE']->baseUrl;
-               }
-               if ($GLOBALS['TSFE']->absRefPrefix) {
-                       $prefix = $GLOBALS['TSFE']->absRefPrefix;
-               }
-               $type = isset($conf['type.']) ? $this->cObj->stdWrap($conf['type'], $conf['type.']) : $conf['type'];
-               $typeConf = $conf[$type . '.'];
-               /** @var $pageRenderer \TYPO3\CMS\Core\Page\PageRenderer */
-               $pageRenderer = $GLOBALS['TSFE']->getPageRenderer();
-
-               // Add SWFobject js-file
-               $pageRenderer->addJsFile(TYPO3_mainDir . 'contrib/flashmedia/swfobject/swfobject.js');
-               $player = isset($typeConf['player.']) ? $this->cObj->stdWrap($typeConf['player'], $typeConf['player.']) : $typeConf['player'];
-               $installUrl = isset($conf['installUrl.']) ? $this->cObj->stdWrap($conf['installUrl'], $conf['installUrl.']) : $conf['installUrl'];
-               if (!$installUrl) {
-                       $installUrl = $prefix . TYPO3_mainDir . 'contrib/flashmedia/swfobject/expressInstall.swf';
-               }
-               // If file is audio and an explicit path has not been set,
-               // take path from audio fallback property
-               if ($type == 'audio' && empty($conf['file'])) {
-                       $conf['file'] = $conf['audioFallback'];
-               }
-               $filename = isset($conf['file.']) ? $this->cObj->stdWrap($conf['file'], $conf['file.']) : $conf['file'];
-               $forcePlayer = isset($conf['forcePlayer.']) ? $this->cObj->stdWrap($conf['forcePlayer'], $conf['forcePlayer.']) : $conf['forcePlayer'];
-               if ($filename && $forcePlayer) {
-                       if (strpos($filename, '://') !== FALSE) {
-                               $conf['flashvars.']['file'] = $filename;
-                       } else {
-                               if ($prefix) {
-                                       $conf['flashvars.']['file'] = $prefix . $filename;
-                               } else {
-                                       $conf['flashvars.']['file'] = str_repeat('../', substr_count($player, '/')) . $filename;
-                               }
-                       }
-               } else {
-                       $player = $filename;
-               }
-               // Write calculated values in conf for the hook
-               $conf['player'] = $player;
-               $conf['installUrl'] = $installUrl;
-               $conf['filename'] = $filename;
-               $conf['prefix'] = $prefix;
-               // Merge with default parameters
-               $conf['flashvars.'] = array_merge((array)$typeConf['default.']['flashvars.'], (array)$conf['flashvars.']);
-               $conf['params.'] = array_merge((array)$typeConf['default.']['params.'], (array)$conf['params.']);
-               $conf['attributes.'] = array_merge((array)$typeConf['default.']['attributes.'], (array)$conf['attributes.']);
-               $conf['embedParams'] = 'flashvars, params, attributes';
-               // Hook for manipulating the conf array, it's needed for some players like flowplayer
-               if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/hooks/class.tx_cms_mediaitems.php']['swfParamTransform'])) {
-                       foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/hooks/class.tx_cms_mediaitems.php']['swfParamTransform'] as $classRef) {
-                               \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($classRef, $conf, $this);
-                       }
-               }
-               if (is_array($conf['flashvars.'])) {
-                       ArrayUtility::remapArrayKeys($conf['flashvars.'], $typeConf['mapping.']['flashvars.']);
-               }
-               $flashvars = 'var flashvars = ' . (count($conf['flashvars.']) ? json_encode($conf['flashvars.']) : '{}') . ';';
-               if (is_array($conf['params.'])) {
-                       ArrayUtility::remapArrayKeys($conf['params.'], $typeConf['mapping.']['params.']);
-               }
-               $params = 'var params = ' . (count($conf['params.']) ? json_encode($conf['params.']) : '{}') . ';';
-               if (is_array($conf['attributes.'])) {
-                       ArrayUtility::remapArrayKeys($conf['attributes.'], $typeConf['attributes.']['params.']);
-               }
-               $attributes = 'var attributes = ' . (count($conf['attributes.']) ? json_encode($conf['attributes.']) : '{}') . ';';
-               $flashVersion = isset($conf['flashVersion.']) ? $this->cObj->stdWrap($conf['flashVersion'], $conf['flashVersion.']) : $conf['flashVersion'];
-               if (!$flashVersion) {
-                       $flashVersion = '9';
-               }
-               $replaceElementIdString = str_replace('.', '', uniqid('mmswf', TRUE));
-               $GLOBALS['TSFE']->register['MMSWFID'] = $replaceElementIdString;
-               $alternativeContent = isset($conf['alternativeContent.']) ? $this->cObj->stdWrap($conf['alternativeContent'], $conf['alternativeContent.']) : $conf['alternativeContent'];
-               $layout = isset($conf['layout.']) ? $this->cObj->stdWrap($conf['layout'], $conf['layout.']) : $conf['layout'];
-               $content = str_replace('###ID###', $replaceElementIdString, $layout);
-               $content = str_replace('###SWFOBJECT###', '<div id="' . $replaceElementIdString . '">' . $alternativeContent . '</div>', $content);
-               $width = isset($conf['width.']) ? $this->cObj->stdWrap($conf['width'], $conf['width.']) : $conf['width'];
-               if (!$width) {
-                       $width = $conf[$type . '.']['defaultWidth'];
-               }
-               $height = isset($conf['height.']) ? $this->cObj->stdWrap($conf['height'], $conf['height.']) : $conf['height'];
-               if (!$height) {
-                       $height = $conf[$type . '.']['defaultHeight'];
-               }
-               $embed = 'swfobject.embedSWF("' . $conf['player'] . '", "' . $replaceElementIdString . '", "' . $width . '", "' . $height . '",
-                               "' . $flashVersion . '", "' . $installUrl . '", ' . $conf['embedParams'] . ');';
-               $script = $flashvars . $params . $attributes . $embed;
-               $pageRenderer->addJsInlineCode($replaceElementIdString, $script);
-               if (isset($conf['stdWrap.'])) {
-                       $content = $this->cObj->stdWrap($content, $conf['stdWrap.']);
-               }
-               return $content;
-       }
-
-}
index 2d99a91..5db3002 100644 (file)
@@ -35,8 +35,6 @@ return array(
                        'bullets' => 'mimetypes-x-content-list-bullets',
                        'table' => 'mimetypes-x-content-table',
                        'uploads' => 'mimetypes-x-content-list-files',
-                       'multimedia' => 'mimetypes-x-content-multimedia',
-                       'media' => 'mimetypes-x-content-multimedia',
                        'menu' => 'mimetypes-x-content-menu',
                        'list' => 'mimetypes-x-content-plugin',
                        'login' => 'mimetypes-x-content-login',
@@ -54,8 +52,6 @@ return array(
                        'bullets' => 'tt_content_bullets.gif',
                        'table' => 'tt_content_table.gif',
                        'uploads' => 'tt_content_uploads.gif',
-                       'multimedia' => 'tt_content_mm.gif',
-                       'media' => 'tt_content_mm.gif',
                        'menu' => 'tt_content_menu.gif',
                        'list' => 'tt_content_list.gif',
                        'login' => 'tt_content_login.gif',
@@ -70,7 +66,7 @@ return array(
        ),
        'interface' => array(
                'always_description' => 0,
-               'showRecordFieldList' => 'CType,header,header_link,bodytext,image,imagewidth,imageorient,media,records,colPos,starttime,endtime,fe_group'
+               'showRecordFieldList' => 'CType,header,header_link,bodytext,image,media,imagewidth,imageorient,records,colPos,starttime,endtime,fe_group'
        ),
        'columns' => array(
                'CType' => array(
@@ -126,16 +122,6 @@ return array(
                                                '--div--'
                                        ),
                                        array(
-                                               'LLL:EXT:cms/locallang_ttc.xlf:CType.I.7',
-                                               'multimedia',
-                                               'i/tt_content_mm.gif'
-                                       ),
-                                       array(
-                                               'LLL:EXT:cms/locallang_ttc.xlf:CType.I.18',
-                                               'media',
-                                               'i/tt_content_mm.gif'
-                                       ),
-                                       array(
                                                'LLL:EXT:cms/locallang_ttc.xlf:CType.I.12',
                                                'menu',
                                                'i/tt_content_menu.gif'
@@ -1262,14 +1248,6 @@ return array(
                                'default' => 0
                        )
                ),
-               'media' => array(
-                       'label' => 'LLL:EXT:cms/locallang_ttc.xlf:media',
-                       'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig('media', array(
-                               'appearance' => array(
-                                       'createNewRelationLinkTitle' => 'LLL:EXT:cms/locallang_ttc.xlf:media.addFileReference'
-                               )
-                       ))
-               ),
                'file_collections' => array(
                        'label' => 'LLL:EXT:cms/locallang_ttc.xlf:file_collections',
                        'config' => array(
@@ -1283,18 +1261,13 @@ return array(
                                'size' => 5,
                        )
                ),
-               'multimedia' => array(
-                       'label' => 'LLL:EXT:cms/locallang_ttc.xlf:multimedia',
-                       'config' => array(
-                               'type' => 'group',
-                               'internal_type' => 'file',
-                               'allowed' => 'txt,html,htm,class,swf,swa,dcr,wav,avi,au,mov,asf,mpg,wmv,mp3,mp4,m4v',
-                               'max_size' => $GLOBALS['TYPO3_CONF_VARS']['BE']['maxFileSize'],
-                               'uploadfolder' => 'uploads/media',
-                               'size' => '2',
-                               'maxitems' => '1',
-                               'minitems' => '0'
-                       )
+               'media' => array(
+                       'label' => 'LLL:EXT:cms/locallang_ttc.xlf:media',
+                       'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig('media', array(
+                               'appearance' => array(
+                                       'createNewRelationLinkTitle' => 'LLL:EXT:cms/locallang_ttc.xlf:media.addFileReference'
+                               )
+                       ))
                ),
                'filelink_size' => array(
                        'label' => 'LLL:EXT:cms/locallang_ttc.xlf:filelink_size',
@@ -1492,8 +1465,7 @@ return array(
                                                    </el>
                                                  </ROOT>
                                                </T3DataStructure>
-                                       ',
-                                       ',media' => file_get_contents(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('cms') . 'flexform_media.xml')
+                                       '
                                ),
                                'search' => array(
                                        'andWhere' => 'CType=\'list\''
@@ -1670,32 +1642,6 @@ return array(
                                        --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.access;access,
                                --div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.extended'
                ),
-               'multimedia' => array(
-                       'showitem' => '--palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.general;general,
-                                       --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.header;header,
-                               --div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.media,
-                                       --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.multimediafiles;multimediafiles,
-                               --div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.appearance,
-                                       --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.frames;frames,
-                               --div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.access,
-                                       --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.visibility;visibility,
-                                       --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.access;access,
-                               --div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.extended'
-               ),
-               'media' => array(
-                       'showitem' => '--palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.general;general,
-                                       --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.header;header,
-                               --div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.media,
-                                       pi_flexform; ;,
-                               --div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.appearance,
-                                       --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.frames;frames,
-                               --div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.access,
-                                       --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.visibility;visibility,
-                                       --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.access;access,
-                               --div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.behaviour,
-                                       bodytext;LLL:EXT:cms/locallang_ttc.xlf:bodytext.ALT.media_formlabel;;richtext:rte_transform[flag=rte_enabled|mode=ts_css],
-                               --div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.extended'
-               ),
                'menu' => array(
                        'showitem' => '--palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.general;general,
                                        --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.header;header,
@@ -1836,10 +1782,6 @@ return array(
                        'showitem' => 'header;LLL:EXT:cms/locallang_ttc.xlf:header_formlabel, --linebreak--, header_layout;LLL:EXT:cms/locallang_ttc.xlf:header_layout_formlabel, header_position;LLL:EXT:cms/locallang_ttc.xlf:header_position_formlabel, date;LLL:EXT:cms/locallang_ttc.xlf:date_formlabel, --linebreak--, header_link;LLL:EXT:cms/locallang_ttc.xlf:header_link_formlabel, --linebreak--, subheader;LLL:EXT:cms/locallang_ttc.xlf:subheader_formlabel',
                        'canNotCollapse' => 1
                ),
-               'multimediafiles' => array(
-                       'showitem' => 'multimedia;LLL:EXT:cms/locallang_ttc.xlf:multimedia_formlabel, bodytext;LLL:EXT:cms/locallang_ttc.xlf:bodytext.ALT.multimedia_formlabel;;nowrap',
-                       'canNotCollapse' => 1
-               ),
                'imagelinks' => array(
                        'showitem' => 'image_zoom;LLL:EXT:cms/locallang_ttc.xlf:image_zoom_formlabel',
                        'canNotCollapse' => 1
index 2edade8..48a3650 100644 (file)
@@ -74,11 +74,6 @@ class ContentObjectRendererTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                'RESTORE_REGISTER' => \TYPO3\CMS\Frontend\ContentObject\RestoreRegisterContentObject::class,
                'TEMPLATE'         => \TYPO3\CMS\Frontend\ContentObject\TemplateContentObject::class,
                'FLUIDTEMPLATE'    => \TYPO3\CMS\Frontend\ContentObject\FluidTemplateContentObject::class,
-               'MULTIMEDIA'       => \TYPO3\CMS\Frontend\ContentObject\MultimediaContentObject::class,
-               'MEDIA'            => \TYPO3\CMS\Frontend\ContentObject\MediaContentObject::class,
-               'SWFOBJECT'        => \TYPO3\CMS\Frontend\ContentObject\ShockwaveFlashObjectContentObject::class,
-               'FLOWPLAYER'       => \TYPO3\CMS\Frontend\ContentObject\FlowPlayerContentObject::class,
-               'QTOBJECT'         => \TYPO3\CMS\Frontend\ContentObject\QuicktimeObjectContentObject::class,
                'SVG'              => \TYPO3\CMS\Frontend\ContentObject\ScalableVectorGraphicsContentObject::class,
                'EDITPANEL'        => \TYPO3\CMS\Frontend\ContentObject\EditPanelContentObject::class
        );
index 1670582..4613d3b 100644 (file)
@@ -301,7 +301,6 @@ CREATE TABLE tt_content (
        target varchar(30) DEFAULT '' NOT NULL,
        section_frame int(11) unsigned DEFAULT '0' NOT NULL,
        date int(10) unsigned DEFAULT '0' NOT NULL,
-       multimedia tinytext,
        image_frames int(11) unsigned DEFAULT '0' NOT NULL,
        recursive tinyint(3) unsigned DEFAULT '0' NOT NULL,
        imageheight mediumint(8) unsigned DEFAULT '0' NOT NULL,
diff --git a/typo3/sysext/mediace/Classes/ContentObject/FlowPlayerContentObject.php b/typo3/sysext/mediace/Classes/ContentObject/FlowPlayerContentObject.php
new file mode 100644 (file)
index 0000000..9edc9b9
--- /dev/null
@@ -0,0 +1,730 @@
+<?php
+namespace TYPO3\CMS\Mediace\ContentObject;
+
+/*
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+
+use TYPO3\CMS\Core\Utility\ArrayUtility;
+
+/**
+ * Contains FlowPlayer class object.
+ *
+ * @author Stanislas Rolland
+ */
+class FlowPlayerContentObject extends \TYPO3\CMS\Frontend\ContentObject\AbstractContentObject {
+
+       /**
+        * File extension to mime type
+        *
+        * @var array
+        */
+       public $mimeTypes = array(
+               'aif' => array(
+                       'audio' => 'audio/aiff'
+               ),
+               'au' => array(
+                       'audio' => 'audio/x-au'
+               ),
+               'avi' => array(
+                       'audio' => 'video/x-msvideo'
+               ),
+               'asf' => array(
+                       'video' => 'video/x-ms-asf'
+               ),
+               'class' => array(
+                       'audio' => 'application/java',
+                       'video' => 'application/java'
+               ),
+               'dcr' => array(
+                       'video' => 'application/x-director'
+               ),
+               'flac' => array(
+                       'audio' => 'audio/flac'
+               ),
+               'flv' => array(
+                       'video' => 'video/x-flv'
+               ),
+               'mp3' => array(
+                       'audio' => 'audio/mpeg'
+               ),
+               'mp4' => array(
+                       'video' => 'video/mp4'
+               ),
+               'oga' => array(
+                       'audio' => 'audio/ogg'
+               ),
+               'ogg' => array(
+                       'audio' => 'audio/ogg',
+                       'video' => 'video/ogg'
+               ),
+               'ogv' => array(
+                       'video' => 'video/ogg'
+               ),
+               'swa' => array(
+                       'audio' => 'audio/x-m4a'
+               ),
+               'mov' => array(
+                       'video' => 'video/quicktime'
+               ),
+               'm4a' => array(
+                       'audio' => 'audio/mp4a-latm'
+               ),
+               'm4v' => array(
+                       'video' => 'video/x-m4v'
+               ),
+               'qt' => array(
+                       'video' => 'video/quicktime'
+               ),
+               'swa' => array(
+                       'audio' => 'application/x-director'
+               ),
+               'swf' => array(
+                       'audio' => 'application/x-shockwave-flash',
+                       'video' => 'application/x-shockwave-flash'
+               ),
+               'wav' => array(
+                       'audio' => 'audio/wave'
+               ),
+               'webm' => array(
+                       'audio' => 'audio/webm',
+                       'video' => 'video/webm'
+               ),
+               'wmv' => array(
+                       'audio' => 'audio/x-ms-wmv'
+               )
+       );
+
+       /**
+        * VideoJS options
+        *
+        * @var array
+        */
+       public $videoJsOptions = array(
+               // Use the browser's controls (iPhone)
+               'useBuiltInControls',
+               // Display control bar below video vs. in front of
+               'controlsBelow',
+               // Make controls visible when page loads
+               'controlsAtStart',
+               // Hide controls when not over the video
+               'controlsHiding',
+               // Will be overridden by localStorage volume if available
+               'defaultVolume',
+               // Players and order to use them
+               'playerFallbackOrder'
+       );
+
+       /**
+        * html5 tag attributes
+        *
+        * @var array
+        */
+       public $html5TagAttributes = array(
+               'autoPlay',
+               'controls',
+               'loop',
+               'preload'
+       );
+
+       /**
+        * Flowplayer captions plugin configuration
+        *
+        * @var array
+        */
+       public $flowplayerCaptionsConfig = array(
+               'plugins' => array(
+                       // The captions plugin
+                       'captions' => array(
+                               'url' => 'plugins/flowplayer.captions-3.2.9.swf',
+                               // Pointer to a content plugin (see below)
+                               'captionTarget' => 'content'
+                       ),
+                       // Configure a content plugin so that it looks good for showing captions
+                       'content' => array(
+                               'url' => 'plugins/flowplayer.content-3.2.8.swf',
+                               'bottom' => 5,
+                               'height' => 40,
+                               'backgroundColor' => 'transparent',
+                               'backgroundGradient' => 'none',
+                               'border' => 0,
+                               'textDecoration' => 'outline',
+                               'style' => array(
+                                       'body' => array(
+                                               'fontSize' => 14,
+                                               'fontFamily' => 'Arial',
+                                               'textAlign' => 'center',
+                                               'color' => '#ffffff'
+                                       )
+                               )
+                       )
+               )
+       );
+
+       /**
+        * Flowplayer audio configuration
+        *
+        * @var array
+        */
+       public $flowplayerAudioConfig = array(
+               'provider' => 'audio',
+               'plugins' => array(
+                       'audio' => array(
+                               'url' => 'plugins/flowplayer.audio-3.2.10.swf'
+                       ),
+                       'controls' => array(
+                               'autoHide' => FALSE,
+                               'fullscreen' => FALSE
+                       )
+               )
+       );
+
+       /**
+        * Flowplayer configuration for the audio description
+        *
+        * @var array
+        */
+       public $flowplayerAudioDescriptionConfig = array(
+               // The controls plugin
+               'plugins' => array(
+                       'controls' => NULL
+               )
+       );
+
+       /**
+        * Rendering the cObject, SWFOBJECT
+        *
+        * @param array $conf Array of TypoScript properties
+        * @return string Output
+        */
+       public function render($conf = array()) {
+               /** @var $pageRenderer \TYPO3\CMS\Core\Page\PageRenderer */
+               $pageRenderer = $GLOBALS['TSFE']->getPageRenderer();
+               $params = ($prefix = '');
+               if ($GLOBALS['TSFE']->baseUrl) {
+                       $prefix = $GLOBALS['TSFE']->baseUrl;
+               }
+               if ($GLOBALS['TSFE']->absRefPrefix) {
+                       $prefix = $GLOBALS['TSFE']->absRefPrefix;
+               }
+               // Initialize content
+               $replaceElementIdString = str_replace('.', '', uniqid('mmswf', TRUE));
+               $GLOBALS['TSFE']->register['MMSWFID'] = $replaceElementIdString;
+               $layout = isset($conf['layout.']) ? $this->cObj->stdWrap($conf['layout'], $conf['layout.']) : $conf['layout'];
+               $content = str_replace('###ID###', $replaceElementIdString, $layout);
+               $type = isset($conf['type.']) ? $this->cObj->stdWrap($conf['type'], $conf['type.']) : $conf['type'];
+               $typeConf = $conf[$type . '.'];
+               // Add Flowplayer js-file
+               $pageRenderer->addJsFile($this->getPathToLibrary('flowplayer/flowplayer-3.2.12.min.js'));
+               // Add Flowpayer css for exprss install
+               $pageRenderer->addCssFile($this->getPathToLibrary('flowplayer/express-install/express-install.css'));
+               // Add videoJS js-file
+               $pageRenderer->addJsFile($this->getPathToLibrary('videojs/video-js/video.js'));
+               // Add videoJS css-file
+               $pageRenderer->addCssFile($this->getPathToLibrary('videojs/video-js/video-js.css'));
+               // Add extended videoJS control bar
+               $pageRenderer->addJsFile($this->getPathToLibrary('videojs/video-js/controls/control-bar.js'));
+               $pageRenderer->addCssFile($this->getPathToLibrary('videojs/video-js/controls/control-bar.css'));
+               // Build Flash configuration
+               $player = isset($typeConf['player.']) ? $this->cObj->stdWrap($typeConf['player'], $typeConf['player.']) : $typeConf['player'];
+               if (!$player) {
+                       $player = $prefix . $this->getPathToLibrary('flowplayer/flowplayer-3.2.16.swf');
+               } elseif (strpos($player, 'EXT:') === 0) {
+                       $player = $GLOBALS['TSFE']->tmpl->getFileName($player);
+               }
+               $installUrl = isset($conf['installUrl.']) ? $this->cObj->stdWrap($conf['installUrl'], $conf['installUrl.']) : $conf['installUrl'];
+               if (!$installUrl) {
+                       $installUrl = $prefix . $this->getPathToLibrary('flowplayer/expressinstall.swf');
+               }
+               $flashVersion = isset($conf['flashVersion.']) ? $this->cObj->stdWrap($conf['flashVersion'], $conf['flashVersion.']) : $conf['flashVersion'];
+               if (!$flashVersion) {
+                       $flashVersion = array(9, 115);
+               }
+               $flashConfiguration = array(
+                       // Flowplayer component
+                       'src' => $player,
+                       // Express install url
+                       'expressInstall' => $installUrl,
+                       // Require at least this Flash version
+                       'version' => $flashVersion,
+                       // Older versions will see a message
+                       'onFail' => '###ONFAIL###'
+               );
+               $flashDownloadUrl = 'http://www.adobe.com/go/getflashplayer';
+               $onFail = 'function()  {
+                       if (!(flashembed.getVersion()[0] > 0)) {
+                               var message = "<p>" + "' . $GLOBALS['TSFE']->sL('LLL:EXT:cms/locallang_ttc.xlf:media.needFlashPlugin') . '" + "</p>" + "<p>" + "<a href=\\"' . $flashDownloadUrl . '\\">' . $GLOBALS['TSFE']->sL('LLL:EXT:cms/locallang_ttc.xlf:media.downloadFlash') . '</a>" + "</p>";
+                               document.getElementById("' . $replaceElementIdString . '_flash_install_info").innerHTML = "<div class=\\"message\\">" + message + "</div>";
+                       }
+               }';
+               $flashConfiguration = json_encode($flashConfiguration);
+               $flashConfiguration = str_replace('"###ONFAIL###"', $onFail, $flashConfiguration);
+               $filename = isset($conf['file.']) ? $this->cObj->stdWrap($conf['file'], $conf['file.']) : $conf['file'];
+               if ($filename) {
+                       if (strpos($filename, '://') !== FALSE) {
+                               $conf['flashvars.']['url'] = $filename;
+                       } else {
+                               if ($prefix) {
+                                       $conf['flashvars.']['url'] = $prefix . $filename;
+                               } else {
+                                       $conf['flashvars.']['url'] = str_repeat('../', substr_count($player, '/')) . $filename;
+                               }
+                       }
+               }
+               if (is_array($conf['sources'])) {
+                       foreach ($conf['sources'] as $key => $source) {
+                               if (strpos($source, '://') === FALSE) {
+                                       $conf['sources'][$key] = $prefix . $source;
+                               }
+                       }
+               }
+               if (is_array($conf['audioSources'])) {
+                       foreach ($conf['audioSources'] as $key => $source) {
+                               if (strpos($source, '://') === FALSE) {
+                                       $conf['audioSources'][$key] = $prefix . $source;
+                               }
+                       }
+               }
+               if (isset($conf['audioFallback']) && strpos($conf['audioFallback'], '://') === FALSE) {
+                       $conf['audioFallback'] = $prefix . $conf['audioFallback'];
+               }
+               if (isset($conf['caption']) && strpos($conf['caption'], '://') === FALSE) {
+                       $conf['caption'] = $prefix . $conf['caption'];
+               }
+               // Write calculated values in conf for the hook
+               $conf['player'] = $player ?: $filename;
+               $conf['installUrl'] = $installUrl;
+               $conf['filename'] = $conf['flashvars.']['url'];
+               $conf['prefix'] = $prefix;
+               // merge with default parameters
+               $conf['flashvars.'] = array_merge((array)$typeConf['default.']['flashvars.'], (array)$conf['flashvars.']);
+               $conf['params.'] = array_merge((array)$typeConf['default.']['params.'], (array)$conf['params.']);
+               $conf['attributes.'] = array_merge((array)$typeConf['default.']['attributes.'], (array)$conf['attributes.']);
+               $conf['embedParams'] = 'flashvars, params, attributes';
+               // Hook for manipulating the conf array, it's needed for some players like flowplayer
+               if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/hooks/class.tx_cms_mediaitems.php']['swfParamTransform'])) {
+                       foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/hooks/class.tx_cms_mediaitems.php']['swfParamTransform'] as $classRef) {
+                               \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($classRef, $conf, $this);
+                       }
+               }
+               // Flowplayer config
+               $flowplayerVideoConfig = array();
+               $flowplayerAudioConfig = array();
+               if (is_array($conf['flashvars.'])) {
+                       ArrayUtility::remapArrayKeys($conf['flashvars.'], $typeConf['mapping.']['flashvars.']);
+               } else {
+                       $conf['flashvars.'] = array();
+               }
+               $conf['videoflashvars'] = $conf['flashvars.'];
+               $conf['audioflashvars'] = $conf['flashvars.'];
+               $conf['audioflashvars']['url'] = $conf['audioFallback'];
+               // Render video sources
+               $videoSources = '';
+               if (is_array($conf['sources'])) {
+                       foreach ($conf['sources'] as $source) {
+                               $fileinfo = \TYPO3\CMS\Core\Utility\GeneralUtility::split_fileref($source);
+                               $mimeType = $this->mimeTypes[$fileinfo['fileext']]['video'];
+                               $videoSources .= '<source src="' . $source . '"' . ($mimeType ? ' type="' . $mimeType . '"' : '') . ' />' . LF;
+                       }
+               }
+               // Render audio sources
+               $audioSources = '';
+               if (is_array($conf['audioSources'])) {
+                       foreach ($conf['audioSources'] as $source) {
+                               $fileinfo = \TYPO3\CMS\Core\Utility\GeneralUtility::split_fileref($source);
+                               $mimeType = $this->mimeTypes[$fileinfo['fileext']]['audio'];
+                               $audioSources .= '<source src="' . $source . '"' . ($mimeType ? ' type="' . $mimeType . '"' : '') . ' />' . LF;
+                       }
+               }
+               // Configure captions
+               if ($conf['type'] === 'video' && isset($conf['caption'])) {
+                       // Assemble captions track tag
+                       $videoCaptions = '<track id="' . $replaceElementIdString . '_captions_track" kind="captions" src="' . $conf['caption'] . '"></track>' . LF;
+                       // Add videoJS extension for captions
+                       $pageRenderer->addJsFile($this->getPathToLibrary('videojs/video-js/controls/captions.js'));
+                       // Flowplayer captions
+                       $conf['videoflashvars']['captionUrl'] = $conf['caption'];
+                       // Flowplayer captions plugin configuration
+                       $flowplayerVideoConfig = array_merge_recursive($flowplayerVideoConfig, $this->flowplayerCaptionsConfig);
+               }
+               // Configure flowplayer audio fallback
+               if (isset($conf['audioFallback'])) {
+                       $flowplayerAudioConfig = array_merge_recursive($flowplayerAudioConfig, $this->flowplayerAudioConfig);
+               }
+               // Configure audio description
+               if ($conf['type'] == 'video') {
+                       if (is_array($conf['audioSources']) && count($conf['audioSources'])) {
+                               // Add videoJS audio description toggle
+                               $pageRenderer->addJsFile($this->getPathToLibrary('videojs/video-js/controls/audio-description.js'));
+                       }
+                       if (isset($conf['audioFallback'])) {
+                               // Audio description flowplayer config (remove controls)
+                               $flowplayerAudioConfig = array_merge_recursive($flowplayerAudioConfig, $this->flowplayerAudioDescriptionConfig);
+                       }
+               }
+               // Assemble Flowplayer configuration
+               if (count($conf['videoflashvars'])) {
+                       $flowplayerVideoConfig = array_merge_recursive($flowplayerVideoConfig, array('clip' => $conf['videoflashvars']));
+               }
+               $flowplayerVideoJsonConfig = str_replace(array('"true"', '"false"'), array('true', 'false'), json_encode($flowplayerVideoConfig));
+               if (count($conf['audioflashvars'])) {
+                       $flowplayerAudioConfig = array_merge_recursive($flowplayerAudioConfig, array('clip' => $conf['audioflashvars']));
+               }
+               $flowplayerAudioJsonConfig = str_replace(array('"true"', '"false"'), array('true', 'false'), json_encode($flowplayerAudioConfig));
+               // Assemble param tags (required?)
+               if (is_array($conf['params.'])) {
+                       ArrayUtility::remapArrayKeys($conf['params.'], $typeConf['mapping.']['params.']);
+               }
+               $videoFlashParams = '';
+               if (is_array($conf['params.'])) {
+                       foreach ($conf['params.'] as $name => $value) {
+                               $videoFlashParams .= '<param name="' . $name . '" value="' . $value . '" />' . LF;
+                       }
+               }
+               $audioFlashParams = $videoFlashParams;
+               // Required param tags
+               $videoFlashParams .= '<param name="movie" value="' . $player . '" />' . LF;
+               $videoFlashParams .= '<param name="flashvars" value=\'config=' . $flowplayerVideoJsonConfig . '\' />' . LF;
+               $audioFlashParams .= '<param name="movie" value="' . $player . '" />' . LF;
+               $audioFlashParams .= '<param name="flashvars" value=\'config=' . $flowplayerAudioJsonConfig . '\' />' . LF;
+               // Assemble audio/video tag attributes
+               $attributes = '';
+               if (is_array($conf['attributes.'])) {
+                       ArrayUtility::remapArrayKeys($conf['attributes.'], $typeConf['attributes.']['params.']);
+               }
+               foreach ($this->html5TagAttributes as $attribute) {
+                       if ($conf['attributes.'][$attribute] === 'true' || $conf['attributes.'][$attribute] === strToLower($attribute) || $conf['attributes.'][$attribute] === $attribute) {
+                               $attributes .= strToLower($attribute) . '="' . strToLower($attribute) . '" ';
+                       }
+               }
+               // Media dimensions
+               $width = isset($conf['width.']) ? $this->cObj->stdWrap($conf['width'], $conf['width.']) : $conf['width'];
+               if (!$width) {
+                       $width = $conf[$type . '.']['defaultWidth'];
+               }
+               $height = isset($conf['height.']) ? $this->cObj->stdWrap($conf['height'], $conf['height.']) : $conf['height'];
+               if (!$height) {
+                       $height = $conf[$type . '.']['defaultHeight'];
+               }
+               // Alternate content
+               $alternativeContent = isset($conf['alternativeContent.']) ? $this->cObj->stdWrap($conf['alternativeContent'], $conf['alternativeContent.']) : $conf['alternativeContent'];
+               // 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;
+                               $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>';
+                               }
+                               $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>';
+                               $content = str_replace('###SWFOBJECT###', '<div id="' . $replaceElementIdString . '_video" class="video-js-box" style="width:' . $width . 'px; height:' . $height . 'px;">' . LF . $divContent . '</div>', $content);
+                       }
+               }
+               // Render audio
+               if ($conf['type'] === 'audio' || $audioSources || isset($conf['audioFallback'])) {
+                       if ($conf['preferFlashOverHtml5']) {
+                               // Flash with audio tag fallback
+                               $flashDivContent = $audioFlashParams . LF . '<audio id="' . $replaceElementIdString . '_audio_element"' . $attributes . ($conf['type'] === 'video' ? ' mediagroup="' . $replaceElementIdString . 'style="position:absolute;left:-10000px;"' : ' controls="controls"') . ' style="width:' . $width . 'px; height:' . $height . 'px;">' . LF . $audioSources . $alternativeContent . LF . '</audio>' . LF;
+                               $divContent = ($conf['type'] === 'video' ? '' : '<div id="' . $replaceElementIdString . '_flash_install_info" class="flash-install-info"></div>' . LF) . '<noscript>' . LF . '<object id="' . $replaceElementIdString . '_audio_flash" type="application/x-shockwave-flash" data="' . $player . '" width="' . ($conf['type'] === 'video' ? 0 : $width) . '" height="' . ($conf['type'] === 'video' ? 0 : $height) . '">' . LF . $flashDivContent . '</object>' . LF . '</noscript>' . LF;
+                               $audioContent = '<div id="' . $replaceElementIdString . '_audio_box" class="audio-flash-container" style="width:' . ($conf['type'] === 'video' ? 0 : $width) . 'px; height:' . ($conf['type'] === 'video' ? 0 : $height) . 'px;">' . LF . $divContent . '</div>';
+                       } else {
+                               // Audio tag with Flash fallback
+                               $audioTagContent = $audioSources;
+                               if (isset($conf['audioflashvars']['url'])) {
+                                       $audioTagContent .= '
+                                               <noscript>' . LF . '<object class="audio-flash-fallback" id="' . $replaceElementIdString . '_audio_flash" type="application/x-shockwave-flash" data="' . $player . '" width="' . $width . '" height="' . $height . '">' . LF . $audioFlashParams . LF . $alternativeContent . LF . '</object>' . LF . '</noscript>';
+                               }
+                               $divContent = ($conf['type'] === 'video' ? '' : '<div id="' . $replaceElementIdString . '_flash_install_info" class="flash-install-info"></div>' . LF) . '<audio id="' . $replaceElementIdString . '_audio_element" class="audio-element"' . $attributes . ($conf['type'] === 'video' ? ' mediagroup="' . $replaceElementIdString . '" style="position:absolute;left:-10000px;"' : ' controls="controls"') . '>' . LF . $audioTagContent . '</audio>' . LF . $audioSourcesEmbeddingJsScript;
+                               $audioContent = '<div id="' . $replaceElementIdString . '_audio_box" class="audio-box" style="width:' . ($conf['type'] === 'video' ? 0 : $width) . 'px; height:' . ($conf['type'] === 'video' ? 0 : $height) . 'px;">' . LF . $divContent . '</div>';
+                       }
+                       if ($conf['type'] === 'audio') {
+                               $content = str_replace('###SWFOBJECT###', $audioContent, $content);
+                       } else {
+                               $content .= LF . $audioContent;
+                       }
+               }
+               // Assemble inline JS code
+               $videoJsSetup = '';
+               $flowplayerHandlers = '';
+               if ($conf['type'] === 'video') {
+                       // Assemble videoJS options
+                       $videoJsOptions = array();
+                       foreach ($this->videoJsOptions as $videoJsOption) {
+                               if (isset($conf['params.'][$videoJsOption])) {
+                                       $videoJsOptions[$videoJsOption] = $conf['params.'][$videoJsOption];
+                               }
+                       }
+                       $videoJsOptions = count($videoJsOptions) ? json_encode($videoJsOptions) : '{}';
+                       // videoJS setup and videoJS listeners for audio description synchronisation
+                       if ($audioSources || isset($conf['audioFallback'])) {
+                               $videoJsSetup = '
+                       var ' . $replaceElementIdString . '_video = VideoJS.setup("' . $replaceElementIdString . '_video_js", ' . $videoJsOptions . ');
+                       var ' . $replaceElementIdString . '_video_element = document.getElementById("' . $replaceElementIdString . '_video_js");
+                       var ' . $replaceElementIdString . '_audio_element = document.getElementById("' . $replaceElementIdString . '_audio_element");
+                       if (!!' . $replaceElementIdString . '_video_element && !!' . $replaceElementIdString . '_audio_element) {
+                               ' . $replaceElementIdString . '_audio_element.muted = true;
+                               VideoJS.addListener(' . $replaceElementIdString . '_video_element, "pause", function () { document.getElementById("' . $replaceElementIdString . '_audio_element").pause(); });
+                               VideoJS.addListener(' . $replaceElementIdString . '_video_element, "play", function () { try {document.getElementById("' . $replaceElementIdString . '_audio_element").currentTime = document.getElementById("' . $replaceElementIdString . '_video_js").currentTime} catch(e) {}; document.getElementById("' . $replaceElementIdString . '_audio_element").play(); });
+                               VideoJS.addListener(' . $replaceElementIdString . '_video_element, "seeked", function () { document.getElementById("' . $replaceElementIdString . '_audio_element").currentTime = document.getElementById("' . $replaceElementIdString . '_video_js").currentTime; });
+                               VideoJS.addListener(' . $replaceElementIdString . '_video_element, "volumechange", function () { document.getElementById("' . $replaceElementIdString . '_audio_element").volume = document.getElementById("' . $replaceElementIdString . '_video_js").volume; });
+                       }';
+                       } else {
+                               $videoJsSetup = '
+                       var ' . $replaceElementIdString . '_video = VideoJS.setup("' . $replaceElementIdString . '_video_js", ' . $videoJsOptions . ');
+                       ';
+                       }
+                       // Prefer Flash or fallback to Flash
+                       $videoSourcesEmbedding = '';
+                       // If we have a video file for Flash
+                       if (isset($conf['filename'])) {
+                               // If we prefer Flash
+                               if ($conf['preferFlashOverHtml5']) {
+                                       $videoTagAssembly = '';
+                                       // Create "source" elements
+                                       if (is_array($conf['sources']) && count($conf['sources'])) {
+                                               foreach ($conf['sources'] as $source) {
+                                                       $fileinfo = \TYPO3\CMS\Core\Utility\GeneralUtility::split_fileref($source);
+                                                       $mimeType = $this->mimeTypes[$fileinfo['fileext']]['video'];
+                                                       $videoTagAssembly .= '
+                       ' . $replaceElementIdString . '_video_js.appendChild($f.extend(document.createElement("source"), {
+                               src: "' . $source . '",
+                               type: "' . $mimeType . '"
+                       }));';
+                                               }
+                                               // Create "track" elements
+                                               if (isset($conf['caption'])) {
+                                                       // Assemble captions track tag
+                                                       // It will take a while before the captions are loaded and parsed...
+                                                       $videoTagAssembly .= '
+                       var track  = document.createElement("track");
+                       track.setAttribute("src", "' . $conf['caption'] . '");
+                       track.setAttribute("id", "' . $replaceElementIdString . '_captions_track");
+                       track.setAttribute("kind", "captions");
+                       ' . $replaceElementIdString . '_video_js.appendChild(track);';
+                                               }
+                                               $videoTagAssembly .= '
+                       $f.extend(' . $replaceElementIdString . '_video_js, {
+                               id: "' . $replaceElementIdString . '_video_js",
+                               className: "video-js",
+                               controls: "controls",
+                               mediagroup: "' . $replaceElementIdString . '",
+                               preload: "none",
+                               width: "' . $width . '",
+                               height: "' . $height . '"
+                       });
+                       ' . $replaceElementIdString . '_video.appendChild(' . $replaceElementIdString . '_video_js);
+                       ' . $replaceElementIdString . '_video.className = "video-js-box";';
+                                               $videoTagAssembly .= $videoJsSetup;
+                                       }
+                                       $videoSourcesEmbedding = '
+               var ' . $replaceElementIdString . '_video = document.getElementById("' . $replaceElementIdString . '_video");
+               var ' . $replaceElementIdString . '_video_js = document.createElement("video");
+               if (flashembed.getVersion()[0] > 0) {
+                               // Flash is available
+                       var videoPlayer = flowplayer("' . $replaceElementIdString . '_video", ' . $flashConfiguration . ', ' . $flowplayerVideoJsonConfig . ').load();
+                       videoPlayer.onBeforeUnload(function () { return false; });
+               } else if (!!' . $replaceElementIdString . '_video_js.canPlayType) {
+                               // Flash is not available: fallback to videoJS if video tag is supported
+                       ' . $videoTagAssembly . '
+               } else {
+                               // Neither Flash nor video is available: offer to install Flash
+                       flashembed("' . $replaceElementIdString . '_video", ' . $flashConfiguration . ');
+               }';
+                               } elseif (is_array($conf['sources'])) {
+                                       // HTML5 is the preferred rendering method
+                                       // Test whether the browser supports any of types of the provided sources
+                                       $supported = array();
+                                       foreach ($conf['sources'] as $source) {
+                                               $fileinfo = \TYPO3\CMS\Core\Utility\GeneralUtility::split_fileref($source);
+                                               $mimeType = $this->mimeTypes[$fileinfo['fileext']]['video'];
+                                               $supported[] = $replaceElementIdString . '_videoTag.canPlayType("' . $mimeType . '") != ""';
+                                       }
+                                       // Testing whether the browser supports the video tag with any of the provided source types
+                                       // If no support, embed flowplayer
+                                       $videoSourcesEmbedding = '
+               var ' . $replaceElementIdString . '_videoTag = document.createElement(\'video\');
+               var ' . $replaceElementIdString . '_video_box = document.getElementById("' . $replaceElementIdString . '_video");
+               if (' . $replaceElementIdString . '_video_box) {
+                       if (!' . $replaceElementIdString . '_videoTag || !' . $replaceElementIdString . '_videoTag.canPlayType || !(' . (count($supported) ? implode(' || ', $supported) : 'false') . ')) {
+                                       // Avoid showing an empty video element
+                               if (document.getElementById("' . $replaceElementIdString . '_video_js")) {
+                                       document.getElementById("' . $replaceElementIdString . '_video_js").style.display = "none";
+                               }
+                               if (flashembed.getVersion()[0] > 0) {
+                                               // Flash is available
+                                       var videoPlayer = flowplayer("' . $replaceElementIdString . '_video", ' . $flashConfiguration . ', ' . $flowplayerVideoJsonConfig . ').load();
+                                       videoPlayer.onBeforeUnload(function () { return false; });
+                               } else {
+                                               // Neither Flash nor video is available: offer to install Flash
+                                       flashembed("' . $replaceElementIdString . '_video", ' . $flashConfiguration . ');
+                               }
+                       } else {' . $videoJsSetup . '
+                       }
+               }';
+                               }
+                       }
+               }
+               // Audio fallback to Flash
+               $audioSourcesEmbedding = '';
+               // If we have an audio file for Flash
+               if (isset($conf['audioFallback'])) {
+                       // If we prefer Flash in
+                       if ($conf['preferFlashOverHtml5']) {
+                               $audioTagAssembly = '';
+                               // Create "source" elements
+                               if (is_array($conf['audioSources']) && count($conf['audioSources'])) {
+                                       foreach ($conf['audioSources'] as $source) {
+                                               $fileinfo = \TYPO3\CMS\Core\Utility\GeneralUtility::split_fileref($source);
+                                               $mimeType = $this->mimeTypes[$fileinfo['fileext']]['audio'];
+                                               $audioTagAssembly .= '
+               ' . $replaceElementIdString . '_audio_element.appendChild($f.extend(document.createElement("source"), {
+                       src: "' . $source . '",
+                       type: "' . $mimeType . '"
+               }));';
+                                       }
+                                       $audioTagAssembly .= '
+               $f.extend(' . $replaceElementIdString . '_audio_element, {
+                       id: "' . $replaceElementIdString . '_audio_element",
+                       className: "audio-element",
+                       controls: "' . ($conf['type'] === 'video' ? '' : 'controls') . '",
+                       mediagroup: "' . $replaceElementIdString . '",
+                       preload: "none",
+                       width: "' . ($conf['type'] === 'video' ? 0 : $width) . 'px",
+                       height: "' . ($conf['type'] === 'video' ? 0 : $height) . 'px"
+               });
+               ' . $replaceElementIdString . '_audio_box.appendChild(' . $replaceElementIdString . '_audio_element);
+               ' . $replaceElementIdString . '_audio_box.className = "audio-box";';
+                               }
+                               $audioSourcesEmbedding = '
+               var ' . $replaceElementIdString . '_audio_box = document.getElementById("' . $replaceElementIdString . '_audio_box");
+               var ' . $replaceElementIdString . '_audio_element = document.createElement("audio");
+               if (flashembed.getVersion()[0] > 0) {
+                               // Flash is available
+                       var audioPlayer = flowplayer("' . $replaceElementIdString . '_audio_box", ' . $flashConfiguration . ', ' . $flowplayerAudioJsonConfig . ').load();
+                       audioPlayer.onBeforeUnload(function () { return false; });
+                       ' . ($conf['type'] === 'video' ? 'audioPlayer.mute();' : '') . '
+               } else if (!!' . $replaceElementIdString . '_audio_element.canPlayType) {
+                               // Flash is not available: fallback to audio element if audio tag is supported
+                       ' . $audioTagAssembly . '
+               } else {
+                               // Neither Flash nor audio is available: offer to install Flash if this is not an audio description of a video
+                       ' . ($conf['type'] === 'video' ? '' : 'flashembed("' . $replaceElementIdString . '_audio_box", ' . $flashConfiguration . ');') . '
+               }';
+                       } elseif (is_array($conf['audioSources'])) {
+                               // HTML5 is the preferred rendering method
+                               // Test whether the browser supports any of types of the provided sources
+                               $supported = array();
+                               foreach ($conf['audioSources'] as $source) {
+                                       $fileinfo = \TYPO3\CMS\Core\Utility\GeneralUtility::split_fileref($source);
+                                       $mimeType = $this->mimeTypes[$fileinfo['fileext']]['audio'];
+                                       $supported[] = $replaceElementIdString . '_audioTag.canPlayType("' . $mimeType . '") != ""';
+                               }
+                               // Testing whether the browser supports the audio tag with any of the provided source types
+                               // If no support, embed flowplayer
+                               $audioSourcesEmbedding = '
+               var ' . $replaceElementIdString . '_audioTag = document.createElement(\'audio\');
+               var ' . $replaceElementIdString . '_audio_box = document.getElementById("' . $replaceElementIdString . '_audio_box");
+               if (' . $replaceElementIdString . '_audio_box) {
+                       if (!' . $replaceElementIdString . '_audioTag || !' . $replaceElementIdString . '_audioTag.canPlayType || !(' . (count($supported) ? implode(' || ', $supported) : 'false') . ')) {
+                                       // Avoid showing an empty audio element
+                               if (document.getElementById("' . $replaceElementIdString . '_audio_element")) {
+                                       document.getElementById("' . $replaceElementIdString . '_audio_element").style.display = "none";
+                               }
+                               if (flashembed.getVersion()[0] > 0) {
+                                       var audioPlayer = flowplayer("' . $replaceElementIdString . '_audio_box", ' . $flashConfiguration . ', ' . $flowplayerAudioJsonConfig . ').load();
+                                       audioPlayer.onBeforeUnload(function () { return false; });
+                                       ' . ($conf['type'] === 'video' ? 'audioPlayer.mute()' : '') . '
+                               } else {
+                                               // Neither Flash nor audio is available: offer to install Flash if this is not an audio description of a video
+                                       ' . ($conf['type'] === 'video' ? '' : 'flashembed("' . $replaceElementIdString . '_audio_box", ' . $flashConfiguration . ');') . '
+                               }
+                       }
+               }';
+                       }
+                       // Flowplayer eventHandlers for audio description synchronisation
+                       $flowplayerHandlers = '';
+                       if ($conf['type'] === 'video') {
+                               $flowplayerHandlers = '
+               if (flashembed.getVersion()[0] > 0) {
+                               // Flash is available
+                       var videoPlayer = flowplayer("' . $replaceElementIdString . '_video");
+                       if (videoPlayer) {
+                                       // Control audio description through video control bar
+                               videoPlayer.onVolume(function (volume) { flowplayer("' . $replaceElementIdString . '_audio_box").setVolume(volume); });
+                               videoPlayer.onMute(function () { flowplayer("' . $replaceElementIdString . '_audio_box").mute(); });
+                               videoPlayer.onUnmute(function () { flowplayer("' . $replaceElementIdString . '_audio_box").unmute(); });
+                               videoPlayer.onPause(function () { flowplayer("' . $replaceElementIdString . '_audio_box").pause(); });
+                               videoPlayer.onResume(function () { flowplayer("' . $replaceElementIdString . '_audio_box").resume(); });
+                               videoPlayer.onStart(function () { flowplayer("' . $replaceElementIdString . '_audio_box").play(); });
+                               videoPlayer.onStop(function () { flowplayer("' . $replaceElementIdString . '_audio_box").stop(); });
+                               videoPlayer.onSeek(function (clip, seconds) { flowplayer("' . $replaceElementIdString . '_audio_box").seek(seconds); });
+                                       // Mute audio description on start
+                               flowplayer("' . $replaceElementIdString . '_audio_box").onStart(function () { this.mute()});
+                                       // Audio description toggle
+                               var videoContainer = document.getElementById("' . $replaceElementIdString . '_video");
+                               var buttonContainer = document.createElement("div");
+                               $f.extend(buttonContainer, {
+                                       id: "' . $replaceElementIdString . '_audio_description_toggle",
+                                       className: "vjs-audio-description-control"
+                               });
+                               var button = document.createElement("div");
+                               buttonContainer.appendChild(button);
+                               buttonContainer.style.position = "relative";
+                               buttonContainer.style.left = (parseInt(' . $width . ', 10)-27) + "px";
+                               videoContainer.parentNode.insertBefore(buttonContainer, videoContainer.nextSibling);
+                               VideoJS.addListener(buttonContainer, "click", function () {
+                                       var buttonContainer = document.getElementById("' . $replaceElementIdString . '_audio_description_toggle");
+                                       var state = buttonContainer.getAttribute("data-state");
+                                       if (state == "enabled") {
+                                               buttonContainer.setAttribute("data-state", "disabled");
+                                               flowplayer("' . $replaceElementIdString . '_audio_box").mute();
+                                       } else {
+                                               buttonContainer.setAttribute("data-state", "enabled");
+                                               flowplayer("' . $replaceElementIdString . '_audio_box").unmute();
+                                       }
+                               });
+                       }
+               }';
+                       }
+               }
+               // Wrap up inline JS code
+               $jsInlineCode = $audioSourcesEmbedding . $videoSourcesEmbedding . $flowplayerHandlers;
+               if ($jsInlineCode) {
+                       $jsInlineCode = 'VideoJS.DOMReady(function(){' . $jsInlineCode . LF . '});';
+               }
+               $pageRenderer->addJsInlineCode($replaceElementIdString, $jsInlineCode);
+               if (isset($conf['stdWrap.'])) {
+                       $content = $this->cObj->stdWrap($content, $conf['stdWrap.']);
+               }
+               return $content;
+       }
+
+       /**
+        * resolves the path to the main contrib directory
+        *
+        * @param string $fileAndFolderName the file to be located
+        * @return string
+        */
+       protected function getPathToLibrary($fileAndFolderName) {
+               return TYPO3_mainDir . 'contrib/' . $fileAndFolderName;
+       }
+}
diff --git a/typo3/sysext/mediace/Classes/ContentObject/MediaContentObject.php b/typo3/sysext/mediace/Classes/ContentObject/MediaContentObject.php
new file mode 100644 (file)
index 0000000..f92f1e2
--- /dev/null
@@ -0,0 +1,299 @@
+<?php
+namespace TYPO3\CMS\Mediace\ContentObject;
+
+/*
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+
+/**
+ * Contains MEDIA class object.
+ *
+ * @author Xavier Perseguers <typo3@perseguers.ch>
+ * @author Steffen Kamper <steffen@typo3.org>
+ */
+class MediaContentObject extends \TYPO3\CMS\Frontend\ContentObject\AbstractContentObject {
+
+       /**
+        * Rendering the cObject, MEDIA
+        *
+        * @param array $conf Array of TypoScript properties
+        * @return string Output
+        */
+       public function render($conf = array()) {
+               $content = '';
+               // Add flex parameters to configuration
+               $flexParams = isset($conf['flexParams.']) ? $this->cObj->stdWrap($conf['flexParams'], $conf['flexParams.']) : $conf['flexParams'];
+               if ($flexParams[0] === '<') {
+                       // It is a content element rather a TS object
+                       $flexParams = \TYPO3\CMS\Core\Utility\GeneralUtility::xml2array($flexParams, 'T3');
+                       foreach ($flexParams['data'] as $sheetData) {
+                               $this->cObj->readFlexformIntoConf($sheetData['lDEF'], $conf['parameter.'], TRUE);
+                       }
+               }
+               // Type is video or audio
+               $conf['type'] = $this->doFlexFormOverlay($conf, 'type');
+               // Video sources
+               $sources = $this->doFlexFormOverlay($conf, 'sources', 'mmSourcesContainer');
+               if (is_array($sources) && count($sources)) {
+                       $conf['sources'] = array();
+                       foreach ($sources as $key => $source) {
+                               if (isset($source['mmSource'])) {
+                                       $source = $source['mmSource'];
+                                       $conf['sources'][$key] = $this->retrieveMediaUrl($source);
+                               }
+                       }
+               } else {
+                       unset($conf['sources']);
+               }
+               // Video fallback and backward compatibility file
+               $videoFallback = $this->doFlexFormOverlay($conf, 'file');
+
+               // Backward compatibility file
+               if ($videoFallback !== NULL) {
+                       $conf['file'] = $this->retrieveMediaUrl($videoFallback);
+               } else {
+                       unset($conf['file']);
+               }
+               // Audio sources
+               $audioSources = $this->doFlexFormOverlay($conf, 'audioSources', 'mmAudioSourcesContainer');
+               if (is_array($audioSources) && count($audioSources)) {
+                       $conf['audioSources'] = array();
+                       foreach ($audioSources as $key => $source) {
+                               if (isset($source['mmAudioSource'])) {
+                                       $source = $source['mmAudioSource'];
+                                       $conf['audioSources'][$key] = $this->retrieveMediaUrl($source);
+                               }
+                       }
+               } else {
+                       unset($conf['audioSources']);
+               }
+               // Audio fallback
+               $audioFallback = $this->doFlexFormOverlay($conf, 'audioFallback');
+               if ($audioFallback) {
+                       $conf['audioFallback'] = $this->retrieveMediaUrl($audioFallback);
+               } else {
+                       unset($conf['audioFallback']);
+               }
+               // Caption file
+               $caption = $this->doFlexFormOverlay($conf, 'caption');
+               if ($caption) {
+                       $conf['caption'] = $this->retrieveMediaUrl($caption);
+               } else {
+                       unset($conf['caption']);
+               }
+               // Establish render type
+               $renderType = $this->doFlexFormOverlay($conf, 'renderType');
+               $conf['preferFlashOverHtml5'] = 0;
+               if ($renderType === 'preferFlashOverHtml5') {
+                       $renderType = 'auto';
+               }
+               if ($renderType === 'auto') {
+                       // Default renderType is swf
+                       $renderType = 'swf';
+                       $handler = array_keys($conf['fileExtHandler.']);
+                       if ($conf['type'] === 'video') {
+                               $fileinfo = \TYPO3\CMS\Core\Utility\GeneralUtility::split_fileref($conf['file']);
+                       } else {
+                               $fileinfo = \TYPO3\CMS\Core\Utility\GeneralUtility::split_fileref($conf['audioFallback']);
+                       }
+                       if (in_array($fileinfo['fileext'], $handler)) {
+                               $renderType = strtolower($conf['fileExtHandler.'][$fileinfo['fileext']]);
+                       }
+               }
+               $mime = $renderType . 'object';
+               $typeConf = $conf['mimeConf.'][$mime . '.'][$conf['type'] . '.'] ?: array();
+               $conf['predefined'] = array();
+               // Width and height
+               $conf['width'] = (int)$this->doFlexFormOverlay($conf, 'width');
+               $conf['height'] = (int)$this->doFlexFormOverlay($conf, 'height');
+               if (is_array($conf['parameter.']['mmMediaOptions'])) {
+                       foreach ($conf['parameter.']['mmMediaOptions'] as $key => $value) {
+                               if ($key == 'mmMediaCustomParameterContainer') {
+                                       foreach ($value as $val) {
+                                               // Custom parameter entry
+                                               $rawTS = $val['mmParamCustomEntry'];
+                                               // Read and merge
+                                               $tmp = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(LF, $rawTS);
+                                               if (count($tmp)) {
+                                                       foreach ($tmp as $tsLine) {
+                                                               if ($tsLine[0] !== '#' && ($pos = strpos($tsLine, '.'))) {
+                                                                       $parts[0] = substr($tsLine, 0, $pos);
+                                                                       $parts[1] = substr($tsLine, $pos + 1);
+                                                                       $valueParts = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode('=', $parts[1], TRUE);
+                                                                       switch (strtolower($parts[0])) {
+                                                                               case 'flashvars':
+                                                                                       $conf['flashvars.'][$valueParts[0]] = $valueParts[1];
+                                                                                       break;
+                                                                               case 'params':
+                                                                                       $conf['params.'][$valueParts[0]] = $valueParts[1];
+                                                                                       break;
+                                                                               case 'attributes':
+                                                                                       $conf['attributes.'][$valueParts[0]] = $valueParts[1];
+                                                                                       break;
+                                                                       }
+                                                               }
+                                                       }
+                                               }
+                                       }
+                               } elseif ($key == 'mmMediaOptionsContainer') {
+                                       foreach ($value as $val) {
+                                               if (isset($val['mmParamSet'])) {
+                                                       $pName = $val['mmParamName'];
+                                                       $pSet = $val['mmParamSet'];
+                                                       $pValue = $pSet == 2 ? $val['mmParamValue'] : ($pSet == 0 ? 'false' : 'true');
+                                                       $conf['predefined'][$pName] = $pValue;
+                                               }
+                                       }
+                               }
+                       }
+               }
+               if ($renderType === 'swf' && $this->doFlexFormOverlay($conf, 'useHTML5')) {
+                       $renderType = 'flowplayer';
+               }
+               if ($conf['type'] === 'audio' && !isset($conf['audioSources'])) {
+                       $renderType = 'swf';
+               }
+               if ($renderType !== 'qt' && $renderType !== 'embed' && $conf['type'] == 'video') {
+                       if (isset($conf['file']) && (strpos($conf['file'], '.swf') !== FALSE || strpos($conf['file'], '://') !== FALSE && strpos(\TYPO3\CMS\Core\Utility\GeneralUtility::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']) && strpos($conf['file'], '://') !== FALSE) {
+                               $mediaWizard = \TYPO3\CMS\Frontend\MediaWizard\MediaWizardProviderManager::getValidMediaWizardProvider($conf['file']);
+                               if ($mediaWizard !== NULL) {
+                                       $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->cObjGetSingle('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->cObjGetSingle('SWFOBJECT', $conf);
+                               break;
+                       case 'qt':
+                               $conf[$conf['type'] . '.'] = array_merge($conf['mimeConf.']['swfobject.'][$conf['type'] . '.'], $typeConf);
+                               $conf = array_merge($conf['mimeConf.']['qtobject.'], $conf);
+                               unset($conf['mimeConf.']);
+                               $conf['params.'] = array_merge((array)$conf['params.'], $conf['predefined']);
+                               $content = $this->cObj->cObjGetSingle('QTOBJECT', $conf);
+                               break;
+                       case 'embed':
+                               $paramsArray = array_merge((array)$typeConf['default.']['params.'], (array)$conf['params.'], $conf['predefined']);
+                               $conf['params'] = '';
+                               foreach ($paramsArray as $key => $value) {
+                                       $conf['params'] .= $key . '=' . $value . LF;
+                               }
+                               $content = $this->cObj->cObjGetSingle('MULTIMEDIA', $conf);
+                               break;
+                       default:
+                               if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/hooks/class.tx_cms_mediaitems.php']['customMediaRender'])) {
+                                       foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/hooks/class.tx_cms_mediaitems.php']['customMediaRender'] as $classRef) {
+                                               $hookObj = \TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($classRef);
+                                               $conf['file'] = $videoFallback;
+                                               $conf['mode'] = is_file(PATH_site . $videoFallback) ? 'file' : 'url';
+                                               if (method_exists($hookObj, 'customMediaRender')) {
+                                                       $content = $hookObj->customMediaRender($renderType, $conf, $this);
+                                               }
+                                       }
+                               }
+                               if (isset($conf['stdWrap.'])) {
+                                       $content = $this->cObj->stdWrap($content, $conf['stdWrap.']);
+                               }
+               }
+               return $content;
+       }
+
+       /**
+        * Resolves the URL of an file
+        *
+        * @param string $file
+        * @return string|NULL
+        */
+       protected function retrieveMediaUrl($file) {
+               $returnValue = NULL;
+
+               // because the file value can possibly have link parameters, use explode to split all values
+               $fileParts = explode(' ', $file);
+
+               /** @var $mediaWizard \TYPO3\CMS\Frontend\MediaWizard\MediaWizardProviderInterface */
+               $mediaWizard = \TYPO3\CMS\Frontend\MediaWizard\MediaWizardProviderManager::getValidMediaWizardProvider($fileParts[0]);
+               // Get the path relative to the page currently outputted
+               if (substr($fileParts[0], 0, 5) === 'file:') {
+                       $fileUid = substr($fileParts[0], 5);
+
+                       if (!empty($fileUid) && \TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($fileUid)) {
+                               $fileObject = \TYPO3\CMS\Core\Resource\ResourceFactory::getInstance()->getFileObject($fileUid);
+
+                               if ($fileObject instanceof \TYPO3\CMS\Core\Resource\FileInterface) {
+                                       $returnValue = $fileObject->getPublicUrl();
+                               }
+                       }
+               } elseif (is_file(PATH_site . $fileParts[0])) {
+                       $returnValue = $GLOBALS['TSFE']->tmpl->getFileName($fileParts[0]);
+               } elseif ($mediaWizard !== NULL) {
+                       $jumpUrlEnabled = $GLOBALS['TSFE']->config['config']['jumpurl_enable'];
+                       $GLOBALS['TSFE']->config['config']['jumpurl_enable'] = 0;
+                       $returnValue = $this->cObj->typoLink_URL(array(
+                               'parameter' => $mediaWizard->rewriteUrl($fileParts[0])
+                       ));
+                       $GLOBALS['TSFE']->config['config']['jumpurl_enable'] = $jumpUrlEnabled;
+               } elseif (\TYPO3\CMS\Core\Utility\GeneralUtility::isValidUrl($fileParts[0])) {
+                       $returnValue = $fileParts[0];
+               }
+
+               return $returnValue;
+       }
+
+       /**
+        * Looks up if the key is set via flexform and returns the actual value.
+        * If not present in flexform, it processes the value which might be given in TS
+        * with stdWrap (if needed) and returns that value.
+        *
+        * @param array &$confArray
+        * @param string $key
+        * @param string $sectionKey
+        * @return mixed
+        */
+       protected function doFlexFormOverlay(array &$confArray, $key, $sectionKey = NULL) {
+               $flexValue = NULL;
+               $flexKey = 'mm' . ucfirst($key);
+               if ($sectionKey === NULL) {
+                       $flexValue = $confArray['parameter.'][$flexKey];
+               } else {
+                       $flexValue = $confArray['parameter.'][$flexKey][$sectionKey];
+               }
+               if ($flexValue === NULL) {
+                       $flexValue = isset($confArray[$key . '.']) ? $this->cObj->stdWrap($confArray[$key], $confArray[$key . '.']) : $confArray[$key];
+               }
+               return $flexValue;
+       }
+
+}
diff --git a/typo3/sysext/mediace/Classes/ContentObject/MultimediaContentObject.php b/typo3/sysext/mediace/Classes/ContentObject/MultimediaContentObject.php
new file mode 100644 (file)
index 0000000..71be09b
--- /dev/null
@@ -0,0 +1,97 @@
+<?php
+namespace TYPO3\CMS\Mediace\ContentObject;
+
+/*
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+
+/**
+ * Contains MULTIMEDIA class object.
+ *
+ * @author Xavier Perseguers <typo3@perseguers.ch>
+ * @author Steffen Kamper <steffen@typo3.org>
+ */
+class MultimediaContentObject extends \TYPO3\CMS\Frontend\ContentObject\AbstractContentObject {
+
+       /**
+        * Rendering the cObject, MULTIMEDIA
+        *
+        * @param array $conf Array of TypoScript properties
+        * @return string Output
+        */
+       public function render($conf = array()) {
+               $content = '';
+               $filename = isset($conf['file.']) ? $this->cObj->stdWrap($conf['file'], $conf['file.']) : $conf['file'];
+               $incFile = $GLOBALS['TSFE']->tmpl->getFileName($filename);
+               if ($incFile) {
+                       $fileinfo = \TYPO3\CMS\Core\Utility\GeneralUtility::split_fileref($incFile);
+                       if (\TYPO3\CMS\Core\Utility\GeneralUtility::inList('txt,html,htm', $fileinfo['fileext'])) {
+                               $content = $GLOBALS['TSFE']->tmpl->fileContent($incFile);
+                       } else {
+                               // Default params...
+                               $parArray = array();
+                               // Src is added
+                               $width = isset($conf['width.']) ? $this->cObj->stdWrap($conf['width'], $conf['width.']) : $conf['width'];
+                               if (!$width) {
+                                       $width = 200;
+                               }
+                               $height = isset($conf['height.']) ? $this->cObj->stdWrap($conf['height'], $conf['height.']) : $conf['height'];
+                               if (!$height) {
+                                       $height = 200;
+                               }
+                               $parArray['src'] = 'src="' . $GLOBALS['TSFE']->absRefPrefix . $incFile . '"';
+                               if (\TYPO3\CMS\Core\Utility\GeneralUtility::inList('au,wav,mp3', $fileinfo['fileext'])) {
+
+                               }
+                               if (\TYPO3\CMS\Core\Utility\GeneralUtility::inList('avi,mov,mpg,asf,wmv', $fileinfo['fileext'])) {
+                                       $parArray['width'] = 'width="' . $width . '"';
+                                       $parArray['height'] = 'height="' . $height . '"';
+                               }
+                               if (\TYPO3\CMS\Core\Utility\GeneralUtility::inList('swf,swa,dcr', $fileinfo['fileext'])) {
+                                       $parArray['quality'] = 'quality="high"';
+                                       $parArray['width'] = 'width="' . $width . '"';
+                                       $parArray['height'] = 'height="' . $height . '"';
+                               }
+                               if (\TYPO3\CMS\Core\Utility\GeneralUtility::inList('class', $fileinfo['fileext'])) {
+                                       $parArray['width'] = 'width="' . $width . '"';
+                                       $parArray['height'] = 'height="' . $height . '"';
+                               }
+                               // fetching params
+                               $params = isset($conf['params.']) ? $this->cObj->stdWrap($conf['params'], $conf['params.']) : $conf['params'];
+                               $lines = explode(LF, $params);
+                               foreach ($lines as $l) {
+                                       $parts = explode('=', $l);
+                                       $parameter = strtolower(trim($parts[0]));
+                                       $value = trim($parts[1]);
+                                       if ((string)$value != '') {
+                                               $parArray[$parameter] = $parameter . '="' . htmlspecialchars($value) . '"';
+                                       } else {
+                                               unset($parArray[$parameter]);
+                                       }
+                               }
+                               if ($fileinfo['fileext'] == 'class') {
+                                       unset($parArray['src']);
+                                       $parArray['code'] = 'code="' . htmlspecialchars($fileinfo['file']) . '"';
+                                       $parArray['codebase'] = 'codebase="' . htmlspecialchars($fileinfo['path']) . '"';
+                                       $content = '<applet ' . implode(' ', $parArray) . '></applet>';
+                               } else {
+                                       $content = '<embed ' . implode(' ', $parArray) . '></embed>';
+                               }
+                       }
+               }
+               if (isset($conf['stdWrap.'])) {
+                       $content = $this->cObj->stdWrap($content, $conf['stdWrap.']);
+               }
+               return $content;
+       }
+
+}
diff --git a/typo3/sysext/mediace/Classes/ContentObject/QuicktimeObjectContentObject.php b/typo3/sysext/mediace/Classes/ContentObject/QuicktimeObjectContentObject.php
new file mode 100644 (file)
index 0000000..8edf29b
--- /dev/null
@@ -0,0 +1,113 @@
+<?php
+namespace TYPO3\CMS\Mediace\ContentObject;
+
+/*
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+
+use TYPO3\CMS\Core\Utility\ArrayUtility;
+
+/**
+ * Contains QTOBJECT content object.
+ *
+ * @author Xavier Perseguers <typo3@perseguers.ch>
+ * @author Steffen Kamper <steffen@typo3.org>
+ */
+class QuicktimeObjectContentObject extends \TYPO3\CMS\Frontend\ContentObject\AbstractContentObject {
+
+       /**
+        * Rendering the cObject, QTOBJECT
+        *
+        * @param array $conf Array of TypoScript properties
+        * @return string Output
+        */
+       public function render($conf = array()) {
+               $params = ($prefix = '');
+               if ($GLOBALS['TSFE']->baseUrl) {
+                       $prefix = $GLOBALS['TSFE']->baseUrl;
+               }
+               if ($GLOBALS['TSFE']->absRefPrefix) {
+                       $prefix = $GLOBALS['TSFE']->absRefPrefix;
+               }
+               $type = isset($conf['type.']) ? $this->cObj->stdWrap($conf['type'], $conf['type.']) : $conf['type'];
+
+               // If file is audio and an explicit path has not been set,
+               // take path from audio fallback property
+               if ($type == 'audio' && empty($conf['file'])) {
+                       $conf['file'] = $conf['audioFallback'];
+               }
+               $filename = isset( $conf['file.'])
+                       ? $this->cObj->stdWrap($conf['file'], $conf['file.'])
+                       : $conf['file'];
+
+               $typeConf = $conf[$type . '.'];
+               // Add QTobject js-file
+               $GLOBALS['TSFE']->getPageRenderer()->addJsFile($this->getPathToLibrary('flashmedia/qtobject/qtobject.js'));
+               $replaceElementIdString = str_replace('.', '', uniqid('mmqt', TRUE));
+               $GLOBALS['TSFE']->register['MMQTID'] = $replaceElementIdString;
+               $qtObject = 'QTObject' . $replaceElementIdString;
+               // Merge with default parameters
+               $conf['params.'] = array_merge((array)$typeConf['default.']['params.'], (array)$conf['params.']);
+               if (is_array($conf['params.'])) {
+                       ArrayUtility::remapArrayKeys($conf['params.'], $typeConf['mapping.']['params.']);
+                       foreach ($conf['params.'] as $key => $value) {
+                               $params .= $qtObject . '.addParam("' . $key . '", "' . $value . '");' . LF;
+                       }
+               }
+               $params = ($params ? substr($params, 0, -2) : '') . LF . $qtObject . '.write("' . $replaceElementIdString . '");';
+               $alternativeContent = isset($conf['alternativeContent.']) ? $this->cObj->stdWrap($conf['alternativeContent'], $conf['alternativeContent.']) : $conf['alternativeContent'];
+               $layout = str_replace(
+                       array(
+                               '###ID###',
+                               '###QTOBJECT###'
+                       ),
+                       array(
+                               $replaceElementIdString,
+                               '<div id="' . $replaceElementIdString . '">' . $alternativeContent . '</div>'
+                       ),
+                       isset($conf['layout.']) ? $this->cObj->stdWrap($conf['layout'], $conf['layout.']) : $conf['layout']
+               );
+               $width = isset($conf['width.']) ? $this->cObj->stdWrap($conf['width'], $conf['width.']) : $conf['width'];
+               if (!$width) {
+                       $width = $conf[$type . '.']['defaultWidth'];
+               }
+               $height = isset($conf['height.']) ? $this->cObj->stdWrap($conf['height'], $conf['height.']) : $conf['height'];
+               if (!$height) {
+                       $height = $conf[$type . '.']['defaultHeight'];
+               }
+               $fullFilename = $filename;
+               // If the file name doesn't contain a scheme, prefix with appropriate data
+               if (strpos($filename, '://') === FALSE && !empty($prefix)) {
+                       $fullFilename = $prefix . $filename;
+               }
+               $embed = 'var ' . $qtObject . ' = new QTObject("' . $fullFilename . '", "' . $replaceElementIdString . '", "' . $width . '", "' . $height . '");';
+               $content = $layout . '
+                       <script type="text/javascript">
+                               ' . $embed . '
+                               ' . $params . '
+                       </script>';
+               if (isset($conf['stdWrap.'])) {
+                       $content = $this->cObj->stdWrap($content, $conf['stdWrap.']);
+               }
+               return $content;
+       }
+
+       /**
+        * resolves the path to the main contrib directory
+        *
+        * @param string $fileAndFolderName the file to be located
+        * @return string
+        */
+       protected function getPathToLibrary($fileAndFolderName) {
+               return TYPO3_mainDir . 'contrib/' . $fileAndFolderName;
+       }
+}
diff --git a/typo3/sysext/mediace/Classes/ContentObject/ShockwaveFlashObjectContentObject.php b/typo3/sysext/mediace/Classes/ContentObject/ShockwaveFlashObjectContentObject.php
new file mode 100644 (file)
index 0000000..02bdf76
--- /dev/null
@@ -0,0 +1,139 @@
+<?php
+namespace TYPO3\CMS\Mediace\ContentObject;
+
+/*
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+
+use TYPO3\CMS\Core\Utility\ArrayUtility;
+
+/**
+ * Contains SWFOBJECT content object.
+ *
+ * @author Xavier Perseguers <typo3@perseguers.ch>
+ * @author Steffen Kamper <steffen@typo3.org>
+ */
+class ShockwaveFlashObjectContentObject extends \TYPO3\CMS\Frontend\ContentObject\AbstractContentObject {
+
+       /**
+        * Rendering the cObject, SWFOBJECT
+        *
+        * @param array $conf Array of TypoScript properties
+        * @return string Output
+        */
+       public function render($conf = array()) {
+               $prefix = '';
+               if ($GLOBALS['TSFE']->baseUrl) {
+                       $prefix = $GLOBALS['TSFE']->baseUrl;
+               }
+               if ($GLOBALS['TSFE']->absRefPrefix) {
+                       $prefix = $GLOBALS['TSFE']->absRefPrefix;
+               }
+               $type = isset($conf['type.']) ? $this->cObj->stdWrap($conf['type'], $conf['type.']) : $conf['type'];
+               $typeConf = $conf[$type . '.'];
+               /** @var $pageRenderer \TYPO3\CMS\Core\Page\PageRenderer */
+               $pageRenderer = $GLOBALS['TSFE']->getPageRenderer();
+
+               // Add SWFobject js-file
+               $pageRenderer->addJsFile($this->getPathToLibrary('flashmedia/swfobject/swfobject.js'));
+               $player = isset($typeConf['player.']) ? $this->cObj->stdWrap($typeConf['player'], $typeConf['player.']) : $typeConf['player'];
+               $installUrl = isset($conf['installUrl.']) ? $this->cObj->stdWrap($conf['installUrl'], $conf['installUrl.']) : $conf['installUrl'];
+               if (!$installUrl) {
+                       $installUrl = $prefix . $this->getPathToLibrary('flashmedia/swfobject/expressInstall.swf');
+               }
+               // If file is audio and an explicit path has not been set,
+               // take path from audio fallback property
+               if ($type == 'audio' && empty($conf['file'])) {
+                       $conf['file'] = $conf['audioFallback'];
+               }
+               $filename = isset($conf['file.']) ? $this->cObj->stdWrap($conf['file'], $conf['file.']) : $conf['file'];
+               $forcePlayer = isset($conf['forcePlayer.']) ? $this->cObj->stdWrap($conf['forcePlayer'], $conf['forcePlayer.']) : $conf['forcePlayer'];
+               if ($filename && $forcePlayer) {
+                       if (strpos($filename, '://') !== FALSE) {
+                               $conf['flashvars.']['file'] = $filename;
+                       } else {
+                               if ($prefix) {
+                                       $conf['flashvars.']['file'] = $prefix . $filename;
+                               } else {
+                                       $conf['flashvars.']['file'] = str_repeat('../', substr_count($player, '/')) . $filename;
+                               }
+                       }
+               } else {
+                       $player = $filename;
+               }
+               // Write calculated values in conf for the hook
+               $conf['player'] = $player;
+               $conf['installUrl'] = $installUrl;
+               $conf['filename'] = $filename;
+               $conf['prefix'] = $prefix;
+               // Merge with default parameters
+               $conf['flashvars.'] = array_merge((array)$typeConf['default.']['flashvars.'], (array)$conf['flashvars.']);
+               $conf['params.'] = array_merge((array)$typeConf['default.']['params.'], (array)$conf['params.']);
+               $conf['attributes.'] = array_merge((array)$typeConf['default.']['attributes.'], (array)$conf['attributes.']);
+               $conf['embedParams'] = 'flashvars, params, attributes';
+               // Hook for manipulating the conf array, it's needed for some players like flowplayer
+               if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/hooks/class.tx_cms_mediaitems.php']['swfParamTransform'])) {
+                       foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/hooks/class.tx_cms_mediaitems.php']['swfParamTransform'] as $classRef) {
+                               \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($classRef, $conf, $this);
+                       }
+               }
+               if (is_array($conf['flashvars.'])) {
+                       ArrayUtility::remapArrayKeys($conf['flashvars.'], $typeConf['mapping.']['flashvars.']);
+               }
+               $flashvars = 'var flashvars = ' . (count($conf['flashvars.']) ? json_encode($conf['flashvars.']) : '{}') . ';';
+               if (is_array($conf['params.'])) {
+                       ArrayUtility::remapArrayKeys($conf['params.'], $typeConf['mapping.']['params.']);
+               }
+               $params = 'var params = ' . (count($conf['params.']) ? json_encode($conf['params.']) : '{}') . ';';
+               if (is_array($conf['attributes.'])) {
+                       ArrayUtility::remapArrayKeys($conf['attributes.'], $typeConf['attributes.']['params.']);
+               }
+               $attributes = 'var attributes = ' . (count($conf['attributes.']) ? json_encode($conf['attributes.']) : '{}') . ';';
+               $flashVersion = isset($conf['flashVersion.']) ? $this->cObj->stdWrap($conf['flashVersion'], $conf['flashVersion.']) : $conf['flashVersion'];
+               if (!$flashVersion) {
+                       $flashVersion = '9';
+               }
+               $replaceElementIdString = str_replace('.', '', uniqid('mmswf', TRUE));
+               $GLOBALS['TSFE']->register['MMSWFID'] = $replaceElementIdString;
+               $alternativeContent = isset($conf['alternativeContent.']) ? $this->cObj->stdWrap($conf['alternativeContent'], $conf['alternativeContent.']) : $conf['alternativeContent'];
+               $layout = isset($conf['layout.']) ? $this->cObj->stdWrap($conf['layout'], $conf['layout.']) : $conf['layout'];
+               $content = str_replace('###ID###', $replaceElementIdString, $layout);
+               $content = str_replace('###SWFOBJECT###', '<div id="' . $replaceElementIdString . '">' . $alternativeContent . '</div>', $content);
+               $width = isset($conf['width.']) ? $this->cObj->stdWrap($conf['width'], $conf['width.']) : $conf['width'];
+               if (!$width) {
+                       $width = $conf[$type . '.']['defaultWidth'];
+               }
+               $height = isset($conf['height.']) ? $this->cObj->stdWrap($conf['height'], $conf['height.']) : $conf['height'];
+               if (!$height) {
+                       $height = $conf[$type . '.']['defaultHeight'];
+               }
+               $embed = 'swfobject.embedSWF("' . $conf['player'] . '", "' . $replaceElementIdString . '", "' . $width . '", "' . $height . '",
+                               "' . $flashVersion . '", "' . $installUrl . '", ' . $conf['embedParams'] . ');';
+               $script = $flashvars . $params . $attributes . $embed;
+               $pageRenderer->addJsInlineCode($replaceElementIdString, $script);
+               if (isset($conf['stdWrap.'])) {
+                       $content = $this->cObj->stdWrap($content, $conf['stdWrap.']);
+               }
+               return $content;
+       }
+
+
+       /**
+        * resolves the path to the main contrib directory
+        *
+        * @param string $fileAndFolderName the file to be located
+        * @return string
+        */
+       protected function getPathToLibrary($fileAndFolderName) {
+               return TYPO3_mainDir . 'contrib/' . $fileAndFolderName;
+       }
+}
diff --git a/typo3/sysext/mediace/Configuration/FlexForms/media.xml b/typo3/sysext/mediace/Configuration/FlexForms/media.xml
new file mode 100644 (file)
index 0000000..8c818f3
--- /dev/null
@@ -0,0 +1,463 @@
+<?xml version="1.0" encoding="utf-8"?>
+<T3DataStructure>
+       <meta>
+               <langDisable>1</langDisable>
+       </meta>
+       <sheets>
+               <sGeneral>
+                       <ROOT>
+                               <TCEforms>
+                                       <sheetTitle>LLL:EXT:cms/locallang_ttc.xml:media.options</sheetTitle>
+                               </TCEforms>
+                               <type>array</type>
+                               <el>
+                                       <mmType>
+                                               <TCEforms>
+                                                       <onChange>reload</onChange>
+                                                       <label>LLL:EXT:cms/locallang_ttc.xml:media.type</label>
+                                                       <config>
+                                                               <type>select</type>
+                                                               <items>
+                                                                       <numIndex index="0">
+                                                                               <numIndex index="0">LLL:EXT:cms/locallang_ttc.xml:media.type.video</numIndex>
+                                                                               <numIndex index="1">video</numIndex>
+                                                                       </numIndex>
+                                                                       <numIndex index="1">
+                                                                               <numIndex index="0">LLL:EXT:cms/locallang_ttc.xml:media.type.audio</numIndex>
+                                                                               <numIndex index="1">audio</numIndex>
+                                                                       </numIndex>
+                                                               </items>
+                                                       </config>
+                                               </TCEforms>
+                                       </mmType>
+                                       <mmUseHTML5>
+                                               <TCEforms>
+                                                       <label>LLL:EXT:cms/locallang_ttc.xml:media.useHTML5</label>
+                                                       <displayCond>FIELD:mmType:!=:audio</displayCond>
+                                                       <onChange>reload</onChange>
+                                                       <config>
+                                                               <type>check</type>
+                                                               <default>0</default>
+                                                       </config>
+                                               </TCEforms>
+                                       </mmUseHTML5>
+                                       <mmWidth>
+                                               <TCEforms>
+                                                       <label>LLL:EXT:cms/locallang_ttc.xml:media.width</label>
+                                                       <config>
+                                                               <type>input</type>
+                                                               <size>8</size>
+                                                               <max>5</max>
+                                                               <eval>trim,num</eval>
+                                                       </config>
+                                               </TCEforms>
+                                       </mmWidth>
+                                       <mmHeight>
+                                               <TCEforms>
+                                                       <label>LLL:EXT:cms/locallang_ttc.xml:media.height</label>
+                                                       <config>
+                                                               <type>input</type>
+                                                               <size>8</size>
+                                                               <max>5</max>
+                                                               <eval>trim,num</eval>
+                                                       </config>
+                                               </TCEforms>
+                                       </mmHeight>
+                                       <mmRenderType>
+                                               <TCEforms>
+                                                       <label>LLL:EXT:cms/locallang_ttc.xml:media.renderType</label>
+                                                       <displayCond>FIELD:mmType:!=:audio</displayCond>
+                                                       <config>
+                                                               <type>select</type>
+                                                               <items>
+                                                                       <numIndex index="0">
+                                                                               <numIndex index="0">LLL:EXT:cms/locallang_ttc.xml:media.renderType.auto</numIndex>
+                                                                               <numIndex index="1">auto</numIndex>
+                                                                       </numIndex>
+                                                                       <numIndex index="1">
+                                                                               <numIndex index="0">LLL:EXT:cms/locallang_ttc.xml:media.renderType.qt</numIndex>
+                                                                               <numIndex index="1">qt</numIndex>
+                                                                       </numIndex>
+                                                                       <numIndex index="2">
+                                                                               <numIndex index="0">LLL:EXT:cms/locallang_ttc.xml:media.renderType.embed</numIndex>
+                                                                               <numIndex index="1">embed</numIndex>
+                                                                       </numIndex>
+                                                               </items>
+                                                               <itemsProcFunc>TYPO3\CMS\Frontend\Hooks\MediaItemHooks->customMediaRenderTypes</itemsProcFunc>
+                                                       </config>
+                                               </TCEforms>
+                                       </mmRenderType>
+                                       <mmMediaOptions>
+                                               <title>LLL:EXT:cms/locallang_ttc.xml:media.additionalOptions</title>
+                                               <type>array</type>
+                                               <section>1</section>
+                                               <el>
+                                                       <mmMediaOptionsContainer>
+                                                               <type>array</type>
+                                                               <title>LLL:EXT:cms/locallang_ttc.xml:media.params</title>
+                                                               <el>
+                                                                       <mmParamName>
+                                                                               <TCEforms>
+                                                                                       <label>LLL:EXT:cms/locallang_ttc.xml:media.params.option</label>
+                                                                                       <config>
+                                                                                               <type>select</type>
+                                                                                               <items>
+                                                                                                       <numIndex index="0">
+                                                                                                               <numIndex index="0">LLL:EXT:cms/locallang_ttc.xml:media.params.autoPlay</numIndex>
+                                                                                                               <numIndex index="1">autoPlay</numIndex>
+                                                                                                       </numIndex>
+                                                                                                       <numIndex index="1">
+                                                                                                               <numIndex index="0">LLL:EXT:cms/locallang_ttc.xml:media.params.loop</numIndex>
+                                                                                                               <numIndex index="1">loop</numIndex>
+                                                                                                       </numIndex>
+                                                                                                       <numIndex index="2">
+                                                                                                               <numIndex index="0">LLL:EXT:cms/locallang_ttc.xml:media.params.quality</numIndex>
+                                                                                                               <numIndex index="1">quality</numIndex>
+                                                                                                       </numIndex>
+                                                                                                       <numIndex index="3">
+                                                                                                               <numIndex index="0">LLL:EXT:cms/locallang_ttc.xml:media.params.preview</numIndex>
+                                                                                                               <numIndex index="1">preview</numIndex>
+                                                                                                       </numIndex>
+                                                                                                       <numIndex index="4">
+                                                                                                               <numIndex index="0">LLL:EXT:cms/locallang_ttc.xml:media.params.allowScriptAccess</numIndex>
+                                                                                                               <numIndex index="1">allowScriptAccess</numIndex>
+                                                                                                       </numIndex>
+                                                                                                       <numIndex index="5">
+                                                                                                               <numIndex index="0">LLL:EXT:cms/locallang_ttc.xml:media.params.allowFullScreen</numIndex>
+                                                                                                               <numIndex index="1">allowFullScreen</numIndex>
+                                                                                                       </numIndex>
+                                                                                                       <numIndex index="6">
+                                                                                                               <numIndex index="0">LLL:EXT:cms/locallang_ttc.xml:media.params.preload</numIndex>
+                                                                                                               <numIndex index="1">preload</numIndex>
+                                                                                                       </numIndex>
+                                                                                                       <numIndex index="7">
+                                                                                                               <numIndex index="0">LLL:EXT:cms/locallang_ttc.xml:media.params.controlsBelow</numIndex>
+                                                                                                               <numIndex index="1">controlsBelow</numIndex>
+                                                                                                       </numIndex>
+                                                                                                       <numIndex index="8">
+                                                                                                               <numIndex index="0">LLL:EXT:cms/locallang_ttc.xml:media.params.controlsAtStart</numIndex>
+                                                                                                               <numIndex index="1">controlsAtStart</numIndex>
+                                                                                                       </numIndex>
+                                                                                                       <numIndex index="9">
+                                                                                                               <numIndex index="0">LLL:EXT:cms/locallang_ttc.xml:media.params.controlsHiding</numIndex>
+                                                                                                               <numIndex index="1">controlsHiding</numIndex>
+                                                                                                       </numIndex>
+                                                                                                       <numIndex index="10">
+                                                                                                               <numIndex index="0">LLL:EXT:cms/locallang_ttc.xml:media.params.defaultVolume</numIndex>
+                                                                                                               <numIndex index="1">defaultVolume</numIndex>
+                                                                                                       </numIndex>
+                                                                                               </items>
+                                                                                               <itemsProcFunc>TYPO3\CMS\Frontend\Hooks\MediaItemHooks->customMediaParams</itemsProcFunc>
+                                                                                       </config>
+                                                                               </TCEforms>
+                                                                       </mmParamName>
+                                                                       <mmParamSet>
+                                                                               <TCEforms>
+                                                                                       <label>LLL:EXT:cms/locallang_ttc.xml:media.params.setTo</label>
+                                                                                       <config>
+                                                                                               <type>select</type>
+                                                                                               <items>
+                                                                                                       <numIndex index="0">
+                                                                                                               <numIndex index="0">LLL:EXT:cms/locallang_ttc.xml:media.params.on</numIndex>
+                                                                                                               <numIndex index="1">1</numIndex>
+                                                                                                       </numIndex>
+                                                                                                       <numIndex index="1">
+                                                                                                               <numIndex index="0">LLL:EXT:cms/locallang_ttc.xml:media.params.off</numIndex>
+                                                                                                               <numIndex index="1">0</numIndex>
+                                                                                                       </numIndex>
+                                                                                                       <numIndex index="2">
+                                                                                                               <numIndex index="0">LLL:EXT:cms/locallang_ttc.xml:media.params.valueEntry</numIndex>
+                                                                                                               <numIndex index="1">2</numIndex>
+                                                                                                       </numIndex>
+                                                                                               </items>
+                                                                                       </config>
+                                                                               </TCEforms>
+                                                                       </mmParamSet>
+                                                                       <mmParamValue&g