From b2c0d4182d238ac3172a7c171c0cc121341f5350 Mon Sep 17 00:00:00 2001
From: Andreas Fernandez <a.fernandez@scripting-base.de>
Date: Tue, 24 Mar 2015 13:53:11 +0100
Subject: [PATCH] [BUGFIX] Allow Video Text Tracks files

This patch allows the selection of vtt files in EXT:mediace 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/38102
Reviewed-by: Carla Froitzheim <cf@computer-foto.de>
Tested-by: Carla Froitzheim <cf@computer-foto.de>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Andreas Fernandez <andreas.fernandez@aspedia.de>
Tested-by: Andreas Fernandez <andreas.fernandez@aspedia.de>
---
 .../mediace/Classes/ContentObject/FlowPlayerContentObject.php  | 3 ++-
 typo3/sysext/mediace/Configuration/FlexForms/media.xml         | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/typo3/sysext/mediace/Classes/ContentObject/FlowPlayerContentObject.php b/typo3/sysext/mediace/Classes/ContentObject/FlowPlayerContentObject.php
index ee1a63600ffa..3c3cc30c4de3 100644
--- a/typo3/sysext/mediace/Classes/ContentObject/FlowPlayerContentObject.php
+++ b/typo3/sysext/mediace/Classes/ContentObject/FlowPlayerContentObject.php
@@ -350,7 +350,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>' . LF;
 			// Add videoJS extension for captions
 			$pageRenderer->addJsFile($this->getPathToLibrary('videojs/video-js/controls/captions.js'));
 			// Flowplayer captions
@@ -521,6 +521,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 .= '
diff --git a/typo3/sysext/mediace/Configuration/FlexForms/media.xml b/typo3/sysext/mediace/Configuration/FlexForms/media.xml
index 8c818f38eb77..d3ece58fbc15 100644
--- a/typo3/sysext/mediace/Configuration/FlexForms/media.xml
+++ b/typo3/sysext/mediace/Configuration/FlexForms/media.xml
@@ -320,7 +320,7 @@
 										</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>
-- 
GitLab