code: function errorHandlerFactory() {
      var _recoverDecodingErrorDate = null;
      var _recoverAudioCodecErrorDate = null;
  
      return function() {
        var now = Date.now();
  
        if (!_recoverDecodingErrorDate || (now - _recoverDecodingErrorDate) > 2000) {
          _recoverDecodingErrorDate = now;
          hls.recoverMediaError();
        }
        else if (!_recoverAudioCodecErrorDate || (now - _recoverAudioCodecErrorDate) > 2000) {
          _recoverAudioCodecErrorDate = now;
          hls.swapAudioCodec();
          hls.recoverMediaError();
        }
        else {
          console.error('Error loading media: File could not be played');
        }
      };
    }
docs: creates an error handler function
  @returns {Function}