[TASK] Allow preload Tag in VideoTagRenderer 05/57305/2
authorGuido Schmechel <guido.schmechel@brandung.de>
Fri, 22 Jun 2018 18:38:40 +0000 (20:38 +0200)
committerAndreas Fernandez <a.fernandez@scripting-base.de>
Fri, 22 Jun 2018 18:54:23 +0000 (20:54 +0200)
Add the preload parameter to the VideoTagRenderer.

Resolves: #84523
Releases: master, 8.7
Change-Id: I961eee2c204d74321854a3a6f093225e2f873aba
Reviewed-on: https://review.typo3.org/57305
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de>
typo3/sysext/core/Classes/Resource/Rendering/VideoTagRenderer.php
typo3/sysext/core/Tests/Unit/Resource/Rendering/VideoTagRendererTest.php

index 3786d7d..6f408b9 100644 (file)
@@ -94,7 +94,7 @@ class VideoTagRenderer implements FileRendererInterface
         if (!empty($options['loop'])) {
             $attributes[] = 'loop';
         }
-        foreach (['class', 'dir', 'id', 'lang', 'style', 'title', 'accesskey', 'tabindex', 'onclick', 'controlsList'] as $key) {
+        foreach (['class', 'dir', 'id', 'lang', 'style', 'title', 'accesskey', 'tabindex', 'onclick', 'controlsList', 'preload'] as $key) {
             if (!empty($options[$key])) {
                 $attributes[] = $key . '="' . htmlspecialchars($options[$key]) . '"';
             }
index dac48ca..62ad5ae 100644 (file)
@@ -94,7 +94,12 @@ class VideoTagRendererTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCas
                 '//:path/myVideoFile',
                 ['controls' => 1, 'controlsList' => 'nodownload'],
                 '<video width="300" height="200" controls controlsList="nodownload"><source src="//:path/myVideoFile" type="video/mp4"></video>',
-            ]
+            ],
+            [
+                '//:path/myVideoFile',
+                ['preload' => 'auto'],
+                '<video width="300" height="200" controls preload="auto"><source src="//:path/myVideoFile" type="video/mp4"></video>',
+            ],
         ];
     }