#89147Media additionalConfig no-cookie attribute is added to video tags
Description
Description:
Typo3 version: 9.5.9
no-cookie attribute is added to
How to reproduce:
Add a media element using an mp4 video file.
Suspected cause:
The ‘no-cookie’ attribute is used for embedded youtube videos and is set via typoscript like this:
lib.contentElement.settings.media.additionalConfig.no-cookie = 1
which causes output like this:
<video controls no-cookie>...</video>
In the \TYPO3\CMS\Core\Resource\Rendering\VideoTagRenderer class we see that all values found in additionalConfig are added as attributes in addition to all values from additionalAttributes
if (isset($options['additionalConfig']) && is_array($options['additionalConfig'])) {
foreach ($options['additionalConfig'] as $key => $value) {
if ((bool)$value) {
$attributes[] = htmlspecialchars($key);
}
}
}
Possible solution:
The above lines could be removed entirely, as additionalAttributes are already available.
Reviews 3
History 616
-
Guido Schmechel commented 09/17/19, 00:12
-
Jarvis H commented 09/17/19, 00:36
Technically yes, it would be a breaking change, perhaps better suited for Typo3 v10.
I agree with your idea to remove the attributes as you suggested, temporarily solving it like that for Typo3 v9.
-
Gerrit Code Review pushed patch set 1 for master to change 61964 status
NewUnder Review 10/12/19, 14:39 -
Gerrit Code Review pushed patch set 2 for master to change 61964 10/26/19, 13:52
-
Gerrit Code Review pushed patch set 3 for master to change 61964 10/31/19, 00:08
-
Gerrit Code Review pushed patch set 4 for master to change 61964 05/25/20, 20:42
-
Mario Wilhelm commented and changed TYPO3 Version
911 PHP Version7.27.4 10/22/21, 13:53If you have videos from mixed sources, e. g. youtube and mp4, then you need the no-cookie for youtube, but not for mp4.
Disabling it will cause youtube to www.youtube.com, and in mp4 everything is fine.
Enabling it shows a validation error for mp4, and in youtube everything is fine (www.youtube-nocookie.com).You have to test, if mp4 then no-cookie=0, if youtube then no-cookie=1
-
Felix Ranesberger commented 09/06/22, 07:29
We reset the configuration of FluidStyledContent again afterwards. YouTube videos are then loaded from https://www.youtube-nocookie.com and the videos no longer contain no-cookie attributes.
The original setting comes as far as I have seen from FluidStyledContent, can this option not simply be removed?
https://github.com/TYPO3-CMS/fluid_styled_content/blob/main/Configuration/TypoScript/Helper/ContentElement.typoscript#L38lib.contentElement.settings.media.additionalConfig.no-cookie >
-
Gerrit Code Review pushed patch set 1 for main to change 89166 04/18/25, 07:17
-
Gerrit Code Review pushed patch set 2 for main to change 89166 04/18/25, 08:33
-
Gerrit Code Review pushed patch set 3 for main to change 89166 04/18/25, 08:38
-
Gerrit Code Review pushed patch set 4 for main to change 89166 04/18/25, 08:44
-
Gerrit Code Review pushed patch set 5 for main to change 89166 04/18/25, 10:03
-
Gerrit Code Review pushed patch set 1 for 13.4 to change 89203 04/23/25, 11:59
-
Georg Ringer commented and changed status
Under ReviewResolved done0 %100 % 04/23/25, 12:50Applied in changeset commit:7432e7a92daa872edaa3a4f53f92c2550974ac8e.
-
Benni Mack changed status
ResolvedClosed 12/02/25, 14:36
The same problem exists with the new “api” setting in the master.
The question is: Does anyone use the typoscript setting for special attributes? Then removing the entire query would be a breaking change.
My suggestion: We remove “no-cookie” and “api” from the array within the VideoTagRenderer.