Bug #89147
openMedia additionalConfig no-cookie attribute is added to video tags
0%
Description
Description:¶
Typo3 version: 9.5.9
no-cookie attribute is added to <video> tags causing html validation errors
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.
Updated by Guido Schmechel about 5 years ago
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.
Updated by Jarvis H about 5 years ago
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.
Updated by Gerrit Code Review about 5 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61964
Updated by Gerrit Code Review about 5 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61964
Updated by Gerrit Code Review about 5 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61964
Updated by Gerrit Code Review over 4 years ago
Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61964
Updated by Mario Wilhelm about 3 years ago
- TYPO3 Version changed from 9 to 11
- PHP Version changed from 7.2 to 7.4
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
Updated by Felix Ranesberger about 2 years ago
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 >