• Register
Welcome to the in5 Answer Exchange! This a place to get answers about in5 (InDesign to HTML5) and make requests.
0 votes

Hi. I'm working on a magazine with a lot of videos in. Is there a way to add the tags "playsinline autoplay loop muted" to all <video>-elements in the exported hpub html code? 

Right now I manually delete the controls="controls"-tag and add "playsinline autoplay loop muted" to the element on all pages and it gets very annoying when you have the edit the exported html-pages every time.

Example code for reference - I've made the text bold where I usually edit and add my own:

Exported code: 

<video width="375" height="667" controls="controls" data-id="4771" poster="assets/images/item_4771.png" data-autoplay="1" data-autodelay="0" data-nopause="1" class="mejs-none">
<source src="assets/media/ThorCover2.mp4" type="video/mp4"/>
<object>      </object>

Edited code:
<video width="375" height="667" data-id="4771" poster="assets/images/item_4771.png" data-autoplay="1" data-autodelay="0" data-nopause="1" class="mejs-none" autoplay loop muted playsinline>
      <source ...."/>
      <object>      </object>
Any help is greatly appreciated. Thanks
asked in how_to by (220 points)
edited by
Did the answer below resolve this for you?
Yes, it worked perfectly. Sorry for not responding sooner. It's been a few hectic weeks and I thought I answered you.
Glad to hear it. :-)

1 Answer

0 votes
Best answer

You can remove the controller using the Media Panel in InDesign (select None).

You can also set loop there.

Autoplay can be set in the Overlays panel.

You can try setting several properties at once in the output by attaching the following as a .js file in the Resources section of the in5 dialog:



The success of that code may depend on whether or not it executes before the media player elements are initialized (I haven't tested it).



answered by (147k points)
selected by
P.S. I added playsinline by default to the current version.