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 <span data-processor="relativetime" data-value="2019-09-17T00:12:54+00:00" > 09/17/19, 00:12 </span>

    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 <span data-processor="relativetime" data-value="2019-09-17T00:36:00+00:00" > 09/17/19, 00:36 </span>

    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 <span data-processor="relativetime" data-value="2019-10-12T14:39:49+00:00" > 10/12/19, 14:39 </span>

  4. Mario Wilhelm commented and changed TYPO3 Version 9 11 PHP Version 7.2 7.4 <span data-processor="relativetime" data-value="2021-10-22T13:53:39+00:00" > 10/22/21, 13:53 </span>

    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

  5. Felix Ranesberger commented <span data-processor="relativetime" data-value="2022-09-06T07:29:23+00:00" > 09/06/22, 07:29 </span>

    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 >
  6. Georg Ringer commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2025-04-23T12:50:09+00:00" > 04/23/25, 12:50 </span>

    Applied in changeset commit:7432e7a92daa872edaa3a4f53f92c2550974ac8e.