http://forge.typo3.org/http://forge.typo3.org/themes/typo3_forge/favicon/favicon.png?17058661692019-05-26T22:02:55ZTYPO3 ForgeTYPO3 Core - Feature #88442: Allow iframe / video (youtube) javascript loading with "defer"http://forge.typo3.org/issues/88442?journal_id=4012932019-05-26T22:02:55ZChristian Hackl
<ul><li><strong>Subject</strong> changed from <i>Allow Iframe / Video javascript loading with "defer"</i> to <i>Allow iframe / video (youtube) javascript loading with "defer"</i></li></ul> TYPO3 Core - Feature #88442: Allow iframe / video (youtube) javascript loading with "defer"http://forge.typo3.org/issues/88442?journal_id=4067182019-09-26T07:18:25ZChristian Eßl
<ul></ul><p>This would be a very helpful addition. <br />Just recently I created a very similar solution by overriding the YouTubeRenderer, but other video media types would also benefit from this feature. I will try to create a patch later.</p> TYPO3 Core - Feature #88442: Allow iframe / video (youtube) javascript loading with "defer"http://forge.typo3.org/issues/88442?journal_id=4067542019-09-26T15:06:34ZChristian Hackl
<ul></ul><p>my current solution is: <a class="external" href="https://extensions.typo3.org/extension/hh_video_extender/">https://extensions.typo3.org/extension/hh_video_extender/</a></p>
<p>currently not the best code, but it does what it should</p> TYPO3 Core - Feature #88442: Allow iframe / video (youtube) javascript loading with "defer"http://forge.typo3.org/issues/88442?journal_id=4210292020-03-28T21:47:44ZGeorg Ringer
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Needs Feedback</i></li></ul><p>this is already possible by default using</p>
<pre><code class="html syntaxhl" data-language="html"><span class="nt"><f:media</span> <span class="na">class=</span><span class="s">"video-embed-item"</span> <span class="na">file=</span><span class="s">"{file}"</span> <span class="na">width=</span><span class="s">"{dimensions.width}"</span> <span class="na">height=</span><span class="s">"{dimensions.height}"</span> <span class="na">alt=</span><span class="s">"{file.alternative}"</span> <span class="na">title=</span><span class="s">"{file.title}"</span> <span class="na">additionalConfig=</span><span class="s">"{additionalAttributes:{defer:'defer'}}"</span> <span class="nt">/></span>
</code></pre>
<p>is that solution ok for you?</p> TYPO3 Core - Feature #88442: Allow iframe / video (youtube) javascript loading with "defer"http://forge.typo3.org/issues/88442?journal_id=4210312020-03-28T22:06:52ZChristian Eßl
<ul></ul><p>No, there is no native "defer" attribute for html videos, so the browser wouldn't know from that information alone, that the video needs to be "lazyloaded".<br />For doing so, you would also need to override the "src" attribute to something like "data-src" and handle the lazyloading logic, that replaces "data-src" with "src" in some custom javascript. Otherwise the src would always be fetched</p>
<p>Question is: Should the core viewhelper support that (to override the attribute name for "src") or should this not be done in the core and better be done by third-party extension code, that implement their own video viewhelper solutions?<br /><a class="external" href="https://developers.google.com/web/fundamentals/performance/lazy-loading-guidance/images-and-video#for_video_acting_as_an_animated_gif_replacement">https://developers.google.com/web/fundamentals/performance/lazy-loading-guidance/images-and-video#for_video_acting_as_an_animated_gif_replacement</a><br />Lazy loading videos is still a bit "tricky" to support all browsers and scenarios well enough.</p> TYPO3 Core - Feature #88442: Allow iframe / video (youtube) javascript loading with "defer"http://forge.typo3.org/issues/88442?journal_id=4210732020-03-29T18:44:19ZChristian Hackl
<ul></ul><p>Yes, unfortunately you're right, especially now with all the privacy data stuff and the needed javascript.<br />Maybe it's not wise to put something like that into the core - it could be a bit tricky with the CookieConsent plugins, at least for users in the EU.<br />Hmm stupid... or?!</p> TYPO3 Core - Feature #88442: Allow iframe / video (youtube) javascript loading with "defer"http://forge.typo3.org/issues/88442?journal_id=4614342022-01-06T23:22:22ZStephan Bauerstephan_bauer@gmx.de
<ul></ul><p>Chrome supports lazy loading for iframes <a class="external" href="https://caniuse.com/?search=loading">https://caniuse.com/?search=loading</a></p>
<p>I made a patch witch includes that:<br /><a class="external" href="https://forge.typo3.org/issues/96477">https://forge.typo3.org/issues/96477</a></p>