2

I have the following HTML markup

<video poster="home-bg.jpg" autoplay="autoplay" loop="loop" muted="" data-autoplay="" playsinline="" width="982" height="552">
<source src="short.mp4" type="video/mp4">
</video>

The problem is that the Joomla editors, at least the two main ones tinyMCE and JCE, are eliminating the attribute playsinline from the Video tag.

I already tried adding exceptions or adding this attribute to valid attributes but I have had not success.

The attribute gets eliminated no matter what.

If I disable all editors the attribute remains but I need the editors active.

Any help?

mickmackusa
  • 43,625
  • 12
  • 83
  • 136
lupoll88
  • 150
  • 13

1 Answers1

0

You can modify how an element is filtered by TinyMCE using the extended_valid_elements in init method, you can specify the html attributes you want to keep:

tinymce.init({selector:'textarea', 
    extended_valid_elements : 'video[autoplay|muted|loop|playsinline|class]'
});
Pons
  • 1,747
  • 1
  • 13
  • 19