dist/howler.js
function() {
          node.currentTime = seek;
          node.muted = sound._muted || self._muted || Howler._muted || node.muted;
          node.volume = sound._volume * Howler.volume();
          node.playbackRate = sound._rate;

          // Some browsers will throw an error if this is called without user interaction.
          try {
            var play = node.play();

            // Support older browsers that don't support promises, and thus don't have this issue.
            if (play && typeof Promise !== 'undefined' && (play instanceof Promise || typeof play.then === 'function')) {
              // Implements a lock to prevent DOMException: The play() request was interrupted by a call to pause().
              self._playLock = true;

              // Set param values immediately.
              setParams();

              // Releases the lock and executes queued actions.
              play
                .then(function() {
                  self._playLock = false;
                  node._unlocked = true;
                  if (!internal) {
                    self._emit('play', sound._id);
                    self._loadQueue();
                  }
                })
                .catch(function() {
                  self._playLock = false;
                  self._emit('playerror', sound._id, 'Playback was unable to start. This is most commonly an issue ' +
                    'on mobile devices and Chrome where playback was not within a user interaction.');

                  // Reset the ended and paused values.
                  sound._ended = true;
                  sound._paused = true;
                });
            } else if (!internal) {
              self._playLock = false;
              setParams();
              self._emit('play', sound._id);
              self._loadQueue();
            }

            // Setting rate before playing won't work in IE, so we set it again here.
            node.playbackRate = sound._rate;

            // If the node is still paused, then we can assume there was a playback issue.
            if (node.paused) {
              self._emit('playerror', sound._id, 'Playback was unable to start. This is most commonly an issue ' +
                'on mobile devices and Chrome where playback was not within a user interaction.');
              return;
            }

            // Setup the end timer on sprites or listen for the ended event.
            if (sprite !== '__default' || sound._loop) {
              self._endTimers[sound._id] = setTimeout(self._ended.bind(self, sound), timeout);
            } else {
              self._endTimers[sound._id] = function() {
                // Fire ended on this audio node.
                self._ended(sound);

                // Clear this listener.
                node.removeEventListener('ended', self._endTimers[sound._id], false);
              };
              node.addEventListener('ended', self._endTimers[sound._id], false);
            }
          } catch (err) {
            self._emit('playerror', sound._id, err);
          }
        }
function() {
          node.currentTime = seek;
          node.muted = sound._muted || self._muted || Howler._muted || node.muted;
          node.volume = sound._volume * Howler.volume();
          node.playbackRate = sound._rate;

          // Some browsers will throw an error if this is called without user interaction.
          try {
            var play = node.play();

            // Support older browsers that don't support promises, and thus don't have this issue.
            if (play && typeof Promise !== 'undefined' && (play instanceof Promise || typeof play.then === 'function')) {
              // Implements a lock to prevent DOMException: The play() request was interrupted by a call to pause().
              self._playLock = true;

              // Set param values immediately.
              setParams();

              // Releases the lock and executes queued actions.
              play
                .then(function() {
                  self._playLock = false;
                  node._unlocked = true;
                  if (!internal) {
                    self._emit('play', sound._id);
                    self._loadQueue();
                  }
                })
                .catch(function() {
                  self._playLock = false;
                  self._emit('playerror', sound._id, 'Playback was unable to start. This is most commonly an issue ' +
                    'on mobile devices and Chrome where playback was not within a user interaction.');

                  // Reset the ended and paused values.
                  sound._ended = true;
                  sound._paused = true;
                });
            } else if (!internal) {
              self._playLock = false;
              setParams();
              self._emit('play', sound._id);
              self._loadQueue();
            }

            // Setting rate before playing won't work in IE, so we set it again here.
            node.playbackRate = sound._rate;

            // If the node is still paused, then we can assume there was a playback issue.
            if (node.paused) {
              self._emit('playerror', sound._id, 'Playback was unable to start. This is most commonly an issue ' +
                'on mobile devices and Chrome where playback was not within a user interaction.');
              return;
            }

            // Setup the end timer on sprites or listen for the ended event.
            if (sprite !== '__default' || sound._loop) {
              self._endTimers[sound._id] = setTimeout(self._ended.bind(self, sound), timeout);
            } else {
              self._endTimers[sound._id] = function() {
                // Fire ended on this audio node.
                self._ended(sound);

                // Clear this listener.
                node.removeEventListener('ended', self._endTimers[sound._id], false);
              };
              node.addEventListener('ended', self._endTimers[sound._id], false);
            }
          } catch (err) {
            self._emit('playerror', sound._id, err);
          }
        }
function ( ) { node . currentTime = seek ; node . muted = sound . _muted || self . _muted || Howler . _muted || node . muted ; node . volume = sound . _volume * Howler . volume ( ) ; node . playbackRate = sound . _rate ; // Some browsers will throw an error if this is called without user interaction. try { var play = node . play ( ) ; // Support older browsers that don't support promises, and thus don't have this issue. if ( play && typeof Promise !== 'undefined' && ( play instanceof Promise || typeof play . then === 'function' ) ) { // Implements a lock to prevent DOMException: The play() request was interrupted by a call to pause(). self . _playLock = true ; // Set param values immediately. setParams ( ) ; // Releases the lock and executes queued actions. play . then ( function ( ) { self . _playLock = false ; node . _unlocked = true ; if ( ! internal ) { self . _emit ( 'play' , sound . _id ) ; self . _loadQueue ( ) ; } } ) . catch ( function ( ) { self . _playLock = false ; self . _emit ( 'playerror' , sound . _id , 'Playback was unable to start. This is most commonly an issue ' + 'on mobile devices and Chrome where playback was not within a user interaction.' ) ; // Reset the ended and paused values. sound . _ended = true ; sound . _paused = true ; } ) ; } else if ( ! internal ) { self . _playLock = false ; setParams ( ) ; self . _emit ( 'play' , sound . _id ) ; self . _loadQueue ( ) ; } // Setting rate before playing won't work in IE, so we set it again here. node . playbackRate = sound . _rate ; // If the node is still paused, then we can assume there was a playback issue. if ( node . paused ) { self . _emit ( 'playerror' , sound . _id , 'Playback was unable to start. This is most commonly an issue ' + 'on mobile devices and Chrome where playback was not within a user interaction.' ) ; return ; } // Setup the end timer on sprites or listen for the ended event. if ( sprite !== '__default' || sound . _loop ) { self . _endTimers [ sound . _id ] = setTimeout ( self . _ended . bind ( self , sound ) , timeout ) ; } else { self . _endTimers [ sound . _id ] = function ( ) { // Fire ended on this audio node. self . _ended ( sound ) ; // Clear this listener. node . removeEventListener ( 'ended' , self . _endTimers [ sound . _id ] , false ) ; } ; node . addEventListener ( 'ended' , self . _endTimers [ sound . _id ] , false ) ; } } catch ( err ) { self . _emit ( 'playerror' , sound . _id , err ) ; } }
Fire this when the sound is ready to play to begin HTML5 Audio playback.
Fire this when the sound is ready to play to begin HTML5 Audio playback .