dist/wavesurfer-html-init.js
/**
   * Instantiate Init class and initialize elements
   *
   * This is done automatically if `window` is defined and
   * `window.WS_StopAutoInit` is not set to true
   *
   * @param {WaveSurfer} WaveSurfer The WaveSurfer library object
   * @param {InitParams} params initialisation options
   */
Instantiate Init class and initialize elements
This is done automatically if `window` is defined and
`window.WS_StopAutoInit` is not set to true


Instantiate Init class and initialize elements This is done automatically if ` window ` is defined and ` window . WS_StopAutoInit ` is not set to true
function Init(WaveSurfer) {
    var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
    _classCallCheck(this, Init);
    if (!WaveSurfer) {
      throw new Error('WaveSurfer is not available!');
    }
    this.WaveSurfer = WaveSurfer;
    var _params = this.params = WaveSurfer.util.extend({}, {
      defaults: {
        backend: 'MediaElement',
        mediaControls: true
      },
      containers: 'wavesurfer',
      pluginCdnTemplate: '//localhost:8080/dist/plugin/wavesurfer.[name].js',
      loadPlugin: function loadPlugin(name, cb) {
        var src = _params.pluginCdnTemplate.replace('[name]', name);
        (0, _loadScript.default)(src, {
          async: false
        }, function (err, plugin) {
          if (err) {
            return console.error("WaveSurfer plugin ".concat(name, " not found at ").concat(src));
          }
          cb(window.WaveSurfer[name]);
        });
      }
    }, params);
    this.containers = typeof _params.containers == 'string' ? document.querySelectorAll(_params.containers) : _params.containers;
    this.pluginCache = {};
    this.instances = [];
    this.initAllEls();
  }
function Init ( WaveSurfer ) { var params = arguments . length > 1 && arguments [ 1 ] !== undefined ? arguments [ 1 ] : { } ; _classCallCheck ( this , Init ) ; if ( ! WaveSurfer ) { throw new Error ( 'WaveSurfer is not available!' ) ; } this . WaveSurfer = WaveSurfer ; var _params = this . params = WaveSurfer . util . extend ( { } , { defaults : { backend : 'MediaElement' , mediaControls : true } , containers : 'wavesurfer' , pluginCdnTemplate : '//localhost:8080/dist/plugin/wavesurfer.[name].js' , loadPlugin : function loadPlugin ( name , cb ) { var src = _params . pluginCdnTemplate . replace ( '[name]' , name ) ; ( 0 , _loadScript . default ) ( src , { async : false } , function ( err , plugin ) { if ( err ) { return console . error ( "WaveSurfer plugin " . concat ( name , " not found at " ) . concat ( src ) ) ; } cb ( window . WaveSurfer [ name ] ) ; } ) ; } } , params ) ; this . containers = typeof _params . containers == 'string' ? document . querySelectorAll ( _params . containers ) : _params . containers ; this . pluginCache = { } ; this . instances = [ ] ; this . initAllEls ( ) ; }
Instantiate Init class and initialize elements
 This is done automatically if `window` is defined and
 `window.WS_StopAutoInit` is not set to true
Instantiate Init class and initialize elements This is done automatically if ` window ` is defined and ` window . WS_StopAutoInit ` is not set to true
/**
     * cache WaveSurfer
     * @private
     */ /**
     * build parameters, cache them in _params so minified builds are smaller
     * @private
     */ // wavesurfer parameter defaults so by default the audio player is // usable with native media element controls // containers to instantiate on, can be selector string or NodeList // @TODO insert plugin CDN URIs // loadPlugin function can be overridden to inject plugin definition // objects, this default function uses load-script to load a plugin // and pass it to a callback // eslint-disable-next-line no-console /**
     * The nodes that should have instances attached to them
     * @type {NodeList}
     */ /** @private */ /**
     * An array of wavesurfer instances
     * @type {Object[]}
     */