[BUGFIX] Allow Video Text Tracks files 37/38137/2
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Tue, 24 Mar 2015 22:35:35 +0000 (23:35 +0100)
committerAndreas Fernandez <andreas.fernandez@aspedia.de>
Tue, 24 Mar 2015 22:39:49 +0000 (23:39 +0100)
This patch allows the selection of vtt files in media elements as caption file.
Additionally, the mandatory "default" attribute is rendered.

Resolves: #65936
Releases: master, 6.2
Change-Id: I7f94857150503e6c03713a61fa3a4d2e093cf326
Reviewed-on: http://review.typo3.org/38137
Reviewed-by: Andreas Fernandez <andreas.fernandez@aspedia.de>
Tested-by: Andreas Fernandez <andreas.fernandez@aspedia.de>
typo3/sysext/cms/flexform_media.xml
typo3/sysext/frontend/Classes/ContentObject/FlowPlayerContentObject.php

index 3e87039..4759097 100644 (file)
                                                                                </module>
                                                                                <params type="array">
                                                                                        <blindLinkOptions>page,folder,mail,spec</blindLinkOptions>
-                                                                                       <allowedExtensions>srt</allowedExtensions>
+                                                                                       <allowedExtensions>srt,vtt</allowedExtensions>
                                                                                </params>
                                                                                <JSopenParams>height=300,width=500,status=0,menubar=0,scrollbars=1</JSopenParams>
                                                                        </link>
index 8782c19..07d670d 100644 (file)
@@ -333,7 +333,7 @@ class FlowPlayerContentObject extends \TYPO3\CMS\Frontend\ContentObject\Abstract
                // 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;
+                       $videoCaptions = '<track id="' . $replaceElementIdString . '_captions_track" kind="captions" src="' . $conf['caption'] . '" default="default" />' . LF;
                        // Add videoJS extension for captions
                        $pageRenderer->addJsFile(TYPO3_mainDir . 'contrib/videojs/video-js/controls/captions.js');
                        // Flowplayer captions
@@ -504,6 +504,7 @@ class FlowPlayerContentObject extends \TYPO3\CMS\Frontend\ContentObject\Abstract
                        track.setAttribute("src", "' . $conf['caption'] . '");
                        track.setAttribute("id", "' . $replaceElementIdString . '_captions_track");
                        track.setAttribute("kind", "captions");
+                       track.setAttribute("default", "default");
                        ' . $replaceElementIdString . '_video_js.appendChild(track);';
                                                }
                                                $videoTagAssembly .= '