Review main Ready for review

70768[FEATURE] Configure muted, loop and controls per video file reference

Sascha Englert CR -1 V +1 Normal +216 −20 updated 11/12/26, 08:01

Commit message

File references to videos get three new toggles next to "Autoplay":
"Muted", "Loop" and "Controls". The local video tag renderer as well
as the YouTube and Vimeo renderers read them from the file reference
unless the option is passed to the renderer directly.

Test this change

Run a command in your clone of the TYPO3 Core. Then try what the change does and vote on Verified in Gerrit. How to review a patch

Check out patch set 35
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/68/70768/35 && git checkout FETCH_HEAD
Cherry-pick onto main
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/68/70768/35 && git cherry-pick FETCH_HEAD

Review

  • Code review CR -1 Needs a vote
    • Garvin Hicking -1
    • Simon Schaufelberger +1
  • Verified V +1 Needs a vote
    • Simon Schaufelberger +1
    • core-ci +1 CI

Merge conflicts 12

Issues 1

Files 9

Review log 73110

Show 5385 earlier messages
  1. Sascha Englert uploaded patch set 1 08/26/21, 11:21

  2. core-ci voted on patch set 1 V -1 08/26/21, 11:25 Core CI is not happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/15662

  3. Sascha Englert uploaded patch set 2 08/26/21, 11:40

  4. core-ci voted on patch set 2 V -1 08/26/21, 12:01 Core CI is not happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/15667

  5. Sascha Englert uploaded patch set 3 08/27/21, 07:55

  6. core-ci voted on patch set 3 V -1 08/27/21, 08:11 Core CI is not happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/15704

  7. Sascha Englert uploaded patch set 4 08/27/21, 08:18

  8. core-ci voted on patch set 4 V +1 08/27/21, 08:40 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/15707

  9. Sascha Englert uploaded patch set 5 08/27/21, 09:39

  10. core-ci voted on patch set 5 V -1 08/27/21, 10:00 Core CI is not happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/15713

  11. core-ci voted on patch set 5 V +1 08/27/21, 11:21 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/15713

  12. Simon Gilli commented on patch set 5 CR -1 08/27/21, 11:23

    Thanks! Found some minor issues on a quick sight.

    VideoTagRenderer.php:35

    That's a breaking change, please revert as breaking changes are not allowed at this time.

    ext_tables.sql:275

    Use tabs for indention here please.
  13. Sascha Englert marked it ready for review 08/27/21, 11:23

  14. Sascha Englert uploaded patch set 6 08/27/21, 11:36

  15. core-ci voted on patch set 6 V +1 08/27/21, 11:51 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/15717

  16. Sascha Englert commented on patch set 6 08/27/21, 13:15

    This change is ready for review.

    VideoTagRenderer.php:35 Reply

    The only place the property is used is in Line 59 and there are no classes that extend the class. As far as I can see I have two options to avoid declaring the array as const: 1) Duplicate the array and add it to my UserFunc Class, which is harder to maintain as mime types may change in the future. 2) Create a getter and use makeInstance to get the array. Creating the an object just for one access is in my opinion a waste of resources.

    ext_tables.sql:275 Reply

    Done
  17. Oliver Klee commented on patch set 6 08/27/21, 13:24

    I don't want to spoil the fun ;-) … but should "fun" be "function" instead? Or something else?
  18. Sascha Englert updated the commit message in patch set 7 08/27/21, 13:25

  19. Sascha Englert commented on patch set 7 08/27/21, 13:26

    Reply

    Done
  20. core-ci voted on patch set 7 V +1 08/27/21, 13:48 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/15726

  21. Oliver Klee wrote 08/27/21, 13:54

    Removed reviewer Oliver Klee.
  22. Sascha Englert uploaded patch set 8 08/30/21, 11:48

  23. Sascha Englert commented on patch set 8 08/30/21, 11:49

    VideoTagRenderer.php:35 Reply

    Added an internal getter instead and injected the renderer into the user func
  24. Sascha Englert uploaded patch set 9 08/30/21, 11:50

  25. core-ci voted on patch set 8 V -1 08/30/21, 11:52 Core CI is not happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/15858

  26. core-ci voted on patch set 9 V -1 08/30/21, 11:54 Core CI is not happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/15859

  27. Sascha Englert uploaded patch set 10 08/30/21, 11:57

  28. core-ci voted on patch set 10 V +1 08/30/21, 12:28 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/15861

  29. Guido Schmechel commented on patch set 10 08/30/21, 21:32

    Hi Sascha, it's nice that someone takes up the approach and wants to continue! I took a look at the whole thing and found a few little things. In addition, I can't add a video to the content element with the current dev version. I get the following error message: Core: Exception handler (WEB): Uncaught TYPO3 Exception: Too few arguments to function TYPO3\CMS\Core\UserFunc\VideoFiles::__construct(), 0 passed in /var/www/html/typo3/sysext/core/Classes/Utility/GeneralUtility.php on line 3266 and exactly 1 expected | ArgumentCountError thrown in file /var/www/html/typo3/sysext/core/Classes/UserFunc/VideoFiles.php in line 35 Caches were all emptied, of course. Maybe you have some clues?
    "user function" (See Olis hint)

    VideoFiles.php:27

    Two spaces before =

    VideoFiles.php:41

    A think the function name is clear enough. Just remove this line :-)

    VideoFiles.php:60

    If I see it correctly, this function is not being used at all so far? If you really want to offer it, you would also have to consider https://docs.typo3.org/c/typo3/cms-core/master/en-us/Changelog/7.5/Feature-61799-ImprovedHandlingOfOnlineMedia.html#register-your-own-online-media-service.

    ext_tables.sql:276

    No backticks neccessary
  30. Sascha Englert uploaded patch set 11 08/31/21, 07:28

  31. Sascha Englert commented on patch set 10 08/31/21, 07:29

    Reply

    Did you start with a clean install? If not deleting var/ should help. I got to admit the whole DI stuff is pretty much black magic to me 😕

    Reply

    Damit, fixed it in gerrit but not in git ...

    VideoFiles.php:27 Reply

    Done

    VideoFiles.php:41 Reply

    Done

    VideoFiles.php:60 Reply

    Hm, I am not 100 % sure whether the class should deal with custom file extensions at this point. It just deals with displaying the correct fields for the known extensions. The developer could always just overwrite/extend the class like the TCA. But yeah you are right, it is currently not in use. So I remove it.

    ext_tables.sql:276 Reply

    Really? I get warnings from phpstorm.
  32. core-ci voted on patch set 11 V +1 08/31/21, 07:47 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/15907

  33. Simon Gilli commented on patch set 11 09/04/21, 21:37

    Thanks for the changes, still some minor things and questions.

    VideoTagRenderer.php:38

    Maybe also write a @todo here so this can be changed for the next major release....

    VideoFiles.php:27

    Looks like this is not used longer in the latest PS.

    ext_tables.sql:276

    I don't think loop is a reserved word, is it?
  34. Sascha Englert uploaded patch set 12 09/06/21, 06:40

  35. Sascha Englert commented on patch set 12 09/06/21, 06:41

    VideoTagRenderer.php:38 Reply

    Done

    VideoFiles.php:27 Reply

    Done

    ext_tables.sql:276 Reply

    Done
  36. core-ci voted on patch set 12 V -1 09/06/21, 07:16 Core CI is not happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/16301

  37. core-ci voted on patch set 12 V +1 09/06/21, 08:53 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/16301

  38. Sascha Englert uploaded patch set 13 09/07/21, 06:55

  39. core-ci voted on patch set 13 V +1 09/07/21, 07:15 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/16366

  40. Sascha Englert commented on patch set 13 09/13/21, 10:42

    ext_tables.sql:276 Reply

    Done
  41. Sascha Englert updated the commit message in patch set 14 09/13/21, 10:59

  42. core-ci voted on patch set 14 V +1 09/13/21, 11:10 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/16640

  43. Simon Gilli commented on patch set 14 09/16/21, 17:38

    VideoTagRenderer.php:35 Reply

    Done
  44. Benni Mack wrote 11/29/21, 10:08

    Change destination moved from master to main
  45. Benni Mack updated the commit message in patch set 15 11/29/21, 13:29

  46. core-ci voted on patch set 15 V +1 11/29/21, 14:34 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/20038

  47. Simon Schaufelberger uploaded patch set 16 03/22/22, 23:31

  48. core-ci voted on patch set 16 V -1 03/22/22, 23:39 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25063

  49. Simon Schaufelberger uploaded patch set 17 03/22/22, 23:51

  50. core-ci voted on patch set 17 V +1 03/22/22, 23:59 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25065

  51. Simon Schaufelberger uploaded patch set 18 06/06/22, 18:24

  52. core-ci voted on patch set 18 V -1 06/06/22, 18:32 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27735

  53. Simon Schaufelberger rebased onto patch set 19 06/06/22, 19:15

  54. core-ci voted on patch set 19 V -1 06/06/22, 19:24 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27743

  55. Oliver Klee commented on patch set 19 06/06/22, 20:56

    Feature-95004-AddedBetterSupportForHTML5VideoTag.rst:1

    According to the CI failure, this needs to be: .. include:: /Includes.rst.txt
  56. Simon Schaufelberger uploaded patch set 20 06/06/22, 21:15

  57. Simon Schaufelberger commented on patch set 19 06/06/22, 21:17

    Feature-95004-AddedBetterSupportForHTML5VideoTag.rst:1 Reply

    Done
  58. Simon Schaufelberger commented on patch set 20 06/06/22, 21:19

    Reply

    Done
  59. core-ci voted on patch set 20 V +1 06/06/22, 21:23 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27757

  60. Oliver Klee wrote 06/10/22, 21:41

    Removed cc Oliver Klee.
  61. Simon Schaufelberger uploaded patch set 21 V +1 06/29/23, 05:50

  62. Simon Schaufelberger uploaded patch set 22 06/29/23, 05:50

  63. core-ci voted on patch set 21 V -1 06/29/23, 06:04 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43095

  64. core-ci voted on patch set 22 V -1 06/29/23, 06:04 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43096

  65. Simon Schaufelberger uploaded patch set 23 V -1 06/29/23, 12:13

  66. core-ci voted on patch set 23 V -1 06/29/23, 12:20 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43111

  67. Simon Schaufelberger uploaded patch set 24 V -1 06/29/23, 13:24

  68. core-ci voted on patch set 24 V +1 06/29/23, 13:32 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43113

  69. Oliver Klee updated the commit message in patch set 25 V +1 06/29/23, 19:55

  70. core-ci voted on patch set 25 V +1 06/29/23, 20:02 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43124

  71. Simon Schaufelberger voted on patch set 25 V +1 CR +1 06/29/23, 23:22

  72. Simon Schaufelberger uploaded patch set 26 CR +1 V +1 06/29/23, 23:31

  73. Simon Schaufelberger voted on patch set 26 V +1 CR +1 06/29/23, 23:32

  74. core-ci voted on patch set 26 V +1 06/29/23, 23:38 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43127

  75. Georg Ringer commented on patch set 26 08/03/24, 08:32

    should we finally bring that to 13? IMO a lot of code can be also removed, also would just hardcoded the mimes in the userfunc instead of calling the videotagrenderer
  76. Garvin Hicking commented on patch set 26 08/05/24, 19:50

    Reply

    The code does need some adjustments (personally not fond of inline static functions), but functionality-wise I'd like to have this. Option like "preload" could maybe even be utilized as a "lazyload" attribute for image sys-file-references. "Spamming" extra very specific tca/db columns though feels a bit like it might be better to have more abstraction for future fields. Serialized data like "crop" isn't too great either, and complexity of an extra relation is high and impacts performance - so in the end I think extra columns with their bool toggles might be ok.
  77. Simon Schaufelberger uploaded patch set 27 CR +1 V +1 12/06/24, 12:26

  78. core-ci voted on patch set 27 V -1 12/06/24, 12:34 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/70704

  79. Simon Schaufelberger uploaded patch set 28 V -1 12/10/24, 15:13

  80. core-ci voted on patch set 28 V -1 12/10/24, 15:24 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/70865

  81. Simon Schaufelberger uploaded patch set 29 V -1 12/10/24, 15:26

  82. core-ci voted on patch set 29 V +1 12/10/24, 15:32 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/70866

  83. Simon Schaufelberger voted on patch set 29 CR +1 V +1 12/10/24, 15:33

  84. Guido Schmechel uploaded patch set 30 CR +1 V +1 12/13/24, 22:13

  85. core-ci voted on patch set 30 V +1 12/13/24, 22:18 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/71079

  1. Simon Schaufelberger voted on patch set 30 CR +1 V +1 12/13/24, 22:20

  2. Guido Schmechel commented on patch set 30 CR -1 12/13/24, 23:31

    VideoTagRenderer.php:125

    In my case, preload=‘none’ was generated by default in the output. It should be 'auto' at 0. The problem could be solved with strict type in match conditions.

    VideoTagRendererTest.php:128

    I think we need a different test here, because this does not match the match function and the attribute is only passed through.
  3. Guido Schmechel uploaded patch set 31 CR +1 V +1 12/15/24, 10:39

  4. Guido Schmechel commented on patch set 31 12/15/24, 10:40

    VideoTagRenderer.php:125 Reply

    Done
  5. core-ci voted on patch set 31 V -1 12/15/24, 10:45 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/71134

  6. Guido Schmechel commented on patch set 31 12/15/24, 10:52

    The unit tests deliberately fail. In the code, the instance of FileInterface is queried, but we send a mock to this test. Unfortunately, I don't know how to control this.
  7. Simon Schaufelberger uploaded patch set 32 V -1 03/27/26, 10:09

  8. Simon Schaufelberger commented on patch set 32 CR +1 V +1 03/27/26, 10:09

    VideoTagRendererTest.php:128 Reply

    Done
  9. Simon Schaufelberger uploaded patch set 33 CR +1 V +1 03/27/26, 10:35

  10. core-ci voted on patch set 32 V -1 03/27/26, 10:36 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/98850

  11. Simon Schaufelberger voted on patch set 33 CR +1 V +1 03/27/26, 10:42

  12. core-ci voted on patch set 33 V +1 03/27/26, 11:12 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/98853

  13. Simon Praetorius commented on patch set 33 CR -1 03/27/26, 11:17

    VideoTagRenderer.php:23

    I don't think this needs to be public

    VideoTagRenderer.php:98

    I'd avoid passing things by reference throughout these methods. Also, I think that these conditions can be simplified quite a bit, e. g. by checking for `FileReference` early. Currently, I find it quite hard to understand what actually happens here.

    VideoTagRenderer.php:101

    I'd avoid that closure and (if really necessary) define a proper private method instead.

    VideoTagRenderer.php:158

    I'd avoid that closure and (if really necessary) define a proper private method instead.

    VideoTagRenderer.php:184

    This could be done separately as a `[TASK]` (and possibly even be backported to v13)

    VideoTagRenderer.php:185

    This is a duplicate of line 196.

    VideoFiles.php:25

    I think this one should be `@internal`, since it's quite limited because of hardcoded field names. Also, it should be `final`.

    sys_file_reference.php:191

    Not sure if that is really useful for editors, since it isn't relevant to the actual content.
  14. Simon Schaufelberger commented on patch set 33 03/27/26, 11:30

    VideoTagRenderer.php:23 Reply

    Done

    VideoTagRenderer.php:98 Reply

    Done

    VideoTagRenderer.php:101 Reply

    Done

    VideoTagRenderer.php:158 Reply

    Done

    VideoTagRenderer.php:185 Reply

    Done

    VideoFiles.php:25 Reply

    Done
  15. Simon Schaufelberger commented on patch set 33 03/27/26, 11:32

    sys_file_reference.php:191 Reply

    any suggestions? That would be helpful because I don't know what to do now as I only finalized the patch from someone else.
  16. Simon Schaufelberger uploaded patch set 34 CR +1 V +1 03/27/26, 11:32

  17. core-ci voted on patch set 34 V +1 03/27/26, 11:42 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/98857

  18. Simon Schaufelberger voted on patch set 34 CR +1 V +1 03/27/26, 11:42

  19. Simon Praetorius commented on patch set 34 03/27/26, 12:27

    VideoTagRenderer.php:97

    Maybe the whole method is now only a foreach loop over some fields and can be stripped altogether?

    VideoTagRenderer.php:117

    I'd remove the magic code here and possibly apply this in a separate patch, probably for `$options` in general, not just related to the file?

    VideoFiles.php:28

    Still thinking about this class. I'm wondering if there's a better way to achieve this. Currently, this feels like a hack. If we don't find a better way, the naming should be improved here and inline documentation should be added which describes why and where this is used.

    sys_file_reference.php:191 Reply

    I'd remove it.
  20. Benni Mack uploaded patch set 35 CR +1 V +1 11/11/26, 13:06

  21. Benni Mack commented on patch set 35 11/11/26, 13:09

    VideoTagRenderer.php:97 Reply

    Done

    VideoTagRenderer.php:117 Reply

    Done

    VideoTagRenderer.php:184 Reply

    Done

    VideoFiles.php:28 Reply

    Done

    sys_file_reference.php:191 Reply

    Done
  22. Benni Mack commented on patch set 35 11/11/26, 13:10

    VideoTagRenderer.php:184 Reply

    I decided against that btw.
  23. core-ci voted on patch set 35 V +1 11/11/26, 13:18 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/114076

  24. Simon Schaufelberger voted on patch set 35 CR +1 V +1 11/11/26, 21:23

  25. Garvin Hicking commented on patch set 35 CR -1 11/12/26, 08:01

    Unresolved

    This generally works, but needs some UI love. Missing labels and the placing of the checkboxes seems a bit awkward, maybe the need be grouped in a palette or so.