Review main Abandoned

80514[FEATURE] Add option to render media added by URL with data-src

Max Frerichs CR 0 V -1 Easy +38 −5 updated 02/19/26, 21:25

Commit message

In some cases (e.g. due to privacy regulation),
direct loading of externally loaded media
such as YouTube videos may be undesirable.
To prevent this, it is often common to use a data-src attribute
instead of the src attribute in the affected tag
to be able to integrate a Consent tool.
Unfortunately, there is currently no way
to replace the src attribute of the iframe with "data-src"
without using XCLASSes.

To fix this, I've added an optional argument called "data-src"
to MediaViewHelper, whose value defaults to false.

This allows integrators to control in their code whether the iframe tag
is rendered with a src or data-src attribute.

Review

  • Code review CR 0
  • Verified V -1
    • core-ci -1 CI

Issues 1

Files 7

Review log 1218

  1. Max Frerichs uploaded patch set 1 08/10/23, 19:19

  2. core-ci voted on patch set 1 V -1 08/10/23, 19:30 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/45355

  3. Max Frerichs uploaded patch set 2 V -1 08/10/23, 19:56

  4. core-ci voted on patch set 2 V -1 08/10/23, 20:03 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/45358

  5. Chris Müller commented on patch set 2 CR -1 08/11/23, 07:07

    Thanks for your contribution. I added some remarks. Please don't forget to add a feature rst as described here: https://docs.typo3.org/m/typo3/guide-contributionworkflow/main/en-us/AddingDocumentation/Index.html

    VimeoRenderer.php:94

    Here you check for a "true" string, but should be a bool?

    YouTubeRenderer.php:94

    Here you check for a "true" string, but should be a bool?

    MediaViewHelper.php:91

    You register the attribute as string, but it has a default value of false (bool). AI am not sure if "data-src" is the correct name for the attribute. From that name it is not really clear what values it can hold. Also, the other attributes are lowerCamelCase, not dashed. Maybe "useDataSrc"?
  6. Benni Mack commented on patch set 2 08/11/23, 20:47

    Hey Max, do you know https://extensions.typo3.org/extension/twoclickmedia ? Maybe we could have a solution like this out-of-the-box in TYPO3 Core with a toggle in e.g. the constant editor to enable this?
  7. Max Frerichs commented on patch set 2 08/11/23, 21:11

    VimeoRenderer.php:94 Reply

    Yes, this is not correct. I'll fix it and change it to bool.

    YouTubeRenderer.php:94 Reply Unresolved

    Acknowledged (see comment above)

    MediaViewHelper.php:91 Reply

    In fact, I had first named the attribute useDataSrc before I renamed it to "data-src" and pushed the patchset. But you are right, "useDataSrc" makes more sense. To the type of the default value: Yeah, you're right. I'll fix it. (adding feature rst as well) Thanks for the remarks!
  8. Max Frerichs uploaded patch set 3 CR -1 V -1 08/11/23, 23:37

  9. Max Frerichs commented on patch set 3 08/11/23, 23:43

    Reply

    Hi Benni, thanks for your input, sounds good to me. I've uploaded a new patchset that implements the option to configure this via TypoScript constant. This extension ships with some default JS, CSS and other assets to provide an overlay. Should this be integrated into the TYPO3 core as well?
  10. core-ci voted on patch set 3 V -1 08/11/23, 23:44 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/45398

  11. Max Frerichs uploaded patch set 4 V -1 08/11/23, 23:44

  12. core-ci voted on patch set 4 V -1 08/11/23, 23:52 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/45399

  13. Max Frerichs uploaded patch set 5 V -1 08/12/23, 00:01

  14. core-ci voted on patch set 5 V -1 08/12/23, 00:08 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/45400

  15. Max Frerichs rebased onto patch set 6 V -1 08/13/23, 10:07

  16. core-ci voted on patch set 6 V -1 08/13/23, 10:14 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/45444

  17. Max Frerichs commented on patch set 6 08/13/23, 11:58

    VimeoRenderer.php:94 Reply

    Done

    MediaViewHelper.php:91 Reply

    Done
  18. Garvin Hicking abandoned the change 02/19/26, 21:25