code: function main() {
      var TIME_STEP_MS = 20;
      var frameCount = sozi.presentation.frames.length;
      var imageIndex = 0;
  
      document.querySelector(".sozi-blank-screen").style.display = "none";
      
      sozi.presentation.frames.forEach(function (currentFrame, currentFrameIndex) {
          console.log("Exporting frame: " + (currentFrameIndex + 1));
  
          sozi.player.jumpToFrame(currentFrameIndex);
  
          // Generate images for the duration of the current frame
          for (var timeMs = 0; timeMs < currentFrame.timeoutMs; timeMs += TIME_STEP_MS, imageIndex ++) {
              window.callPhantom(imageIndex);
          }
  
          // Generate images for the transition to the next frame.
          // If the last frame has a timeout enabled, transition to the first frame.
          if (currentFrameIndex < frameCount - 1 || currentFrame.timeoutEnable) {
              if (typeof sozi.player.nextFrameIndex === "number") {
                  sozi.player.targetFrameIndex = sozi.player.nextFrameIndex; // Sozi < 18
              }
              else {
                  sozi.player.targetFrame = sozi.player.nextFrame; // Sozi 18
              }
  
              sozi.viewport.cameras.forEach(function (camera) {
                  var lp = sozi.player.targetFrame.layerProperties[camera.layer.index];
                  sozi.player.setupTransition(camera, sozi.Timing[lp.transitionTimingFunction], lp.transitionRelativeZoom, lp.transitionPath, false);
              });
  
              for (timeMs = 0; timeMs < sozi.player.targetFrame.transitionDurationMs; timeMs += TIME_STEP_MS, imageIndex ++) {
                  sozi.player.onAnimatorStep(timeMs / sozi.player.targetFrame.transitionDurationMs);
                  window.callPhantom(imageIndex);
              }
          }
      });
  }
docs: /*
  Sandboxed function