shinsenter / defer.js

🥇 A lightweight JavaScript library that helps you lazy load (almost) anything. Defer.js is dependency-free, highly efficient, and optimized for Web Vitals.
https://shinsenter.github.io/defer.js/
MIT License
277 stars 45 forks source link

defer js not working with soundmanager #99

Closed kressly closed 3 years ago

kressly commented 3 years ago

Here is a link to soundmanager WITHOUT defer where all sound can be played and are working and here is another link to the same soundmanager WITH defer where due to type="deferjs" the sound can not be played. Please how to fix it ?

shinsenter commented 3 years ago

@kressly The official website says that you must call setup() method when lazyloading the library.

soundManager.setup({
  url: '/path/to/swfs/', 
  onready: function() {
    // soundManager.createSound() etc. here
  }
});

Ref: http://www.schillmania.com/projects/soundmanager2/doc/getstarted/#lazy-loading