Issue Bug Closed

#89147Media additionalConfig no-cookie attribute is added to video tags

Jarvis H 09/11/19, 12:09 updated 12/02/25, 14:36

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

  1. Guido Schmechel commented 09/17/19, 00:12

    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.

  2. 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.

  3. Gerrit Code Review pushed patch set 1 for master to change 61964 status New Under Review 10/12/19, 14:39

  4. Gerrit Code Review pushed patch set 2 for master to change 61964 10/26/19, 13:52

  5. Gerrit Code Review pushed patch set 3 for master to change 61964 10/31/19, 00:08

  6. Gerrit Code Review pushed patch set 4 for master to change 61964 05/25/20, 20:42

  7. Mario Wilhelm commented and changed TYPO3 Version 9 11 PHP Version 7.2 7.4 10/22/21, 13:53

    If 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

  8. 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#L38

    lib.contentElement.settings.media.additionalConfig.no-cookie >
  9. Gerrit Code Review pushed patch set 1 for main to change 89166 04/18/25, 07:17

  10. Gerrit Code Review pushed patch set 2 for main to change 89166 04/18/25, 08:33

  11. Gerrit Code Review pushed patch set 3 for main to change 89166 04/18/25, 08:38

  12. Gerrit Code Review pushed patch set 4 for main to change 89166 04/18/25, 08:44

  13. Gerrit Code Review pushed patch set 5 for main to change 89166 04/18/25, 10:03

  14. Gerrit Code Review pushed patch set 1 for 13.4 to change 89203 04/23/25, 11:59

  15. Georg Ringer commented and changed status Under Review Resolved done 0 % 100 % 04/23/25, 12:50

    Applied in changeset commit:7432e7a92daa872edaa3a4f53f92c2550974ac8e.

  16. Benni Mack changed status Resolved Closed 12/02/25, 14:36