function validateEnvMapSrc(src, isCubemapCb, isEquirectCb) {
  var el;
  var cubemapSrcRegex = '';
  var i;
  var urls;
  var validatedUrls = [];
  if (typeof src === 'string') {
    for (i = 0; i < 5; i++) {
      cubemapSrcRegex += '(url\\((?:[^\\)]+)\\),\\s*)';
    }
    cubemapSrcRegex += '(url\\((?:[^\\)]+)\\)\\s*)';
    urls = src.match(new RegExp(cubemapSrcRegex));

    // `src` is a comma-separated list of URLs.
    // In this case, re-use validateSrc for each side of the cube.
    function isImageCb(url) {
      validatedUrls.push(url);
      if (validatedUrls.length === 6) {
        isCubemapCb(validatedUrls);
      }
    }
    if (urls) {
      for (i = 1; i < 7; i++) {
        validateSrc(parseUrl(urls[i]), isImageCb);
      }
      return;
    }

    // Single URL src
    if (!src.startsWith('#')) {
      var parsedSrc = parseUrl(src);
      if (parsedSrc) {
        validateSrc(parsedSrc, isEquirectCb);
      } else {
        validateSrc(src, isEquirectCb);
      }
      return;
    }
  }

  // `src` is either an element or a query selector to an element (<a-cubemap> or <img>).
  if (src.tagName) {
    el = src;
  } else {
    el = validateAndGetQuerySelector(src);
  }
  if (!el) {
    return;
  }
  if (el.tagName === 'A-CUBEMAP' && el.srcs) {
    return isCubemapCb(el.srcs);
  }
  if (el.tagName === 'IMG') {
    return isEquirectCb(el);
  }
  // Else if el is not a valid element, either <a-cubemap> or <img>.
  warn('Selector "%s" does not point to <a-cubemap> or <img>', src);
}
Validates either six images as a cubemap or one image as an Equirectangular image.

@param {string} src - A selector, image URL or comma-separated image URLs. Image URLS
          must be wrapped by `url()`.
@param {function} isCubemapCb - callback if src is a cubemap.
@param {function} isEquirectCb - callback if src is a singular equirectangular image.