[TASK] Allow preload Tag in VideoTagRenderer 74/57274/2
authorGuido Schmechel <guido.schmechel@brandung.de>
Wed, 20 Jun 2018 16:27:28 +0000 (18:27 +0200)
committerAndreas Fernandez <a.fernandez@scripting-base.de>
Fri, 22 Jun 2018 18:34:00 +0000 (20:34 +0200)
Add the preload parameter to the VideoTagRenderer.

Resolves: #84523
Releases: master, 8.7
Change-Id: I961eee2c204d74321854a3a6f093225e2f873aba
Reviewed-on: https://review.typo3.org/57274
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Joerg Boesche <typo3@joergboesche.de>
Tested-by: Joerg Boesche <typo3@joergboesche.de>
Reviewed-by: Frans Saris <franssaris@gmail.com>
Tested-by: Frans Saris <franssaris@gmail.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Tested-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
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 719802c..92e672e 100644 (file)
@@ -112,7 +112,7 @@ class VideoTagRenderer implements FileRendererInterface
             }
         }
 
-        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 6c26362..a7be7ad 100644 (file)
@@ -127,7 +127,12 @@ class VideoTagRendererTest extends UnitTestCase
                     ]
                 ],
                 '<video muted="muted" foo="bar" data-js-required="yes" data-custom-id="video-123" width="300" height="200" controls playsinline><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>',
+            ],
         ];
     }