0

Essentially I'm moving a static HTML site into Craft. I've created a new plugin for the site and have gotten a good chunk of it working however I'm having an issue where audio files won't play. The site is supposed to have music auto-playing and looping (it's a site for kids before you start judging me, haha), and it works correcrtly on the static site, however nothing plays in my Craft instance and when I go to the direct URL for the audio file it won't play in browser either but doesn't give me a 404. If I "Save As" it does then download correctly.

Code is very simple:

<audio autoplay loop>
        <source src="{{ resourceUrl('somesite/audio/some_theme_full.ogg') }}" type="audio/ogg">
        <source src="{{ resourceUrl('somesite/audio/some_theme_full.mp3') }}" type="audio/mpeg">
</audio>

The src generates correctly as e.g http://site.local/cpresources/somesite/audio/some_theme_full.mp3?d=1513706441.

Ashley Mills
  • 50,474
  • 16
  • 129
  • 160
Owen Davey
  • 1,202
  • 1
  • 12
  • 18

1 Answers1

0

Are you using the same browser to visit the existing site and to develop with? Try incognito mode on the original site.

…web browsers are moving towards stricter autoplay policies in order to improve the user experience, minimize incentives to install ad blockers, and reduce data consumption on expensive and/or constrained networks.

More here on Google's recent autoplay policy changes.

Seth Warburton
  • 2,234
  • 1
  • 16
  • 17