Feature #93784

Set muted attribute for videos in Textmedia if autoplay is active

Added by Wolfgang Wagner 7 months ago. Updated 6 months ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Frontend
Target version:
-
Start date:
2021-03-19
Due date:
% Done:

0%

Estimated time:
PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

In most current browsers, autoplay for videos (and audio files) seems to work only if the video has no audio track or is muted. (see https://www.w3schools.com/tags/att_video_autoplay.asp)

Therefore, it might make sense to set the attribute "muted" if the option "autoplay" is activated in the content element "textmedia". The generated code would then be, for example:

<video controls autoplay muted>
  <source src="movie.mp4" type="video/mp4">
</video> 

Perhaps an additional checkbox would also be possible to set the attribute "controls" or not.

#1

Updated by Wolfgang Wagner 7 months ago

  • Subject changed from Set muted aittrubute for videos in Textmedia if autoplay is active to Set muted attribute for videos in Textmedia if autoplay is active

In most current browsers, autoplay for videos (and audio files) seems to work only if the video has no audio track or is muted. (see https://www.w3schools.com/tags/att_video_autoplay.asp)

Therefore, it might make sense to set the attribute "muted" if the option "autoplay" is activated in the content element "textmedia". The generated code would then be, for example:

<video controls autoplay muted>
  <source src="movie.mp4" type="video/mp4">
</video>

Perhaps an additional checkbox would also be possible to set the attribute "controls" or not.

#2

Updated by Martin Kutschker 7 months ago

Had the same idea. I only wondered if we should let editors try their luck and provide them with a "mute" checkbox.

#3

Updated by Martin Kutschker 7 months ago

Not so sure about "controls". What about "loop" and "poster" :)

The latter has an interesting question: should'nt the poster image be stored with the video? If so, do we need an override for the reference?

#4

Updated by Riccardo De Contardi 7 months ago

  • Category set to Frontend
#5

Updated by Richard Haeser 6 months ago

I'm in favour of sensible defaults, so in that regard I would say: mute it when autoplay is set to true. But... I do think that you should be able that people can set the mute option on non-autoplay videos as well. So having an option to set it (or unset if they want to override the default behaviour) would be great. The downside is that indeed, we should have options for other properties as well which might cause to many options for an editor. So not completely convinced yet. Maybe just mute it and make room for a 3rd party extension to add more options to video's. In that case only if you need those extra options, you install the extension.

Also available in: Atom PDF