function emitReady() {
  if (canInitializeElements) {
    return;
  }
  canInitializeElements = true;
  setTimeout(function () {
    document.dispatchEvent(new CustomEvent('aframeready'));
  });
}
Signals A-Frame that everything is ready to initialize.