Picture of Shaneshwar Bhagat
Re: Auto-play Media
by Shaneshwar Bhagat - Thursday, 9 January 2020, 6:04 AM

Hi Russell,

Just for extra info on this forum. Yes if you are using adapt-contrib-media then you can either change by

1. Autoplay in media.hbs

 <audio  autoplay src="{{_media.mp3}}" type="audio/mp3" style="width: 100%; height: 100%;"/> 

and use 

"_media": {
  } in component.json. Do 'Display:none' to all other layers.

 2. OR you can also add Autoplay to video tag in media.hbs and use below mentioned player options,

 "_playerOptions": {
        "loop": true,
        "clickToPlayPause": true
Their are many other options available.
If you need only audio then keep audio controls to 'display: block' and rest all to 'display:none'.
Alternatively if you are specific to audio only then you can use 'adapt-audio' plugin made by Kineo and change their .HBS file with 'autoplay' property their also.