soundmanager.builder.es6.js 774 B

123456789101112131415161718192021222324252627282930
  1. /**
  2. * @file
  3. * Audiofield build SoundManager audio player.
  4. */
  5. (($, Drupal) => {
  6. 'use strict';
  7. /**
  8. * Attach the behaviors to generate the audio player.
  9. *
  10. * @type {Drupal~behavior}
  11. *
  12. * @prop {Drupal~behaviorAttach} attach
  13. * Attaches generation of Soundmanager audio players.
  14. */
  15. Drupal.behaviors.audiofieldsoundmanager = {
  16. attach: (context, settings) => {
  17. // Soundmanager intercepts everything so the setup is very simple.
  18. soundManager.setup({
  19. // Required: path to directory containing SM2 SWF files.
  20. url: settings.audiofieldsoundmanager.swfpath,
  21. preferFlash: false,
  22. defaultOptions: {
  23. volume: settings.audiofieldsoundmanager.volume,
  24. },
  25. });
  26. },
  27. };
  28. })(jQuery, Drupal);