minerender 2.1.0-alpha.85 → 2.1.0-alpha.86

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2421,6 +2421,53 @@ declare class SceneExporter {
2421
2421
  static toGLTF(root: Object3D, options?: SceneGLTFExportOptions): Promise<Record<string, any> | ArrayBuffer>;
2422
2422
  }
2423
2423
 
2424
+ /** Settings passed to {@link Renderer.toVideo}. */
2425
+ interface VideoExportOptions {
2426
+ /** Recording duration in seconds, greater than zero and at most 2147483.647. */
2427
+ duration: number;
2428
+ /** Requested capture rate (default 30). Rendering and browser scheduling can lower the actual rate. */
2429
+ fps?: number;
2430
+ /** Supported video MIME type. Defaults to WebM when available, then MP4. */
2431
+ mimeType?: string;
2432
+ /** Target video bitrate in bits per second, as a positive unsigned 32-bit integer. */
2433
+ videoBitsPerSecond?: number;
2434
+ /** Cancels recording and discards its output. */
2435
+ signal?: AbortSignal;
2436
+ }
2437
+ /**
2438
+ * Records fresh canvas frames in a browser, at a fixed size with an opaque black background.
2439
+ * @internal
2440
+ */
2441
+ declare class VideoExporter {
2442
+ private readonly source;
2443
+ /** Resolves after the recorder provides its final video data. */
2444
+ readonly result: Promise<Blob>;
2445
+ private readonly canvas;
2446
+ private readonly context;
2447
+ private readonly signal?;
2448
+ private readonly duration;
2449
+ private stream?;
2450
+ private recorder?;
2451
+ private timer?;
2452
+ private readonly chunks;
2453
+ private settled;
2454
+ private stopping;
2455
+ private resolve;
2456
+ private reject;
2457
+ constructor(source: HTMLCanvasElement, options: VideoExportOptions);
2458
+ /** Copies a freshly drawn source frame before WebGL can clear its drawing buffer. */
2459
+ capture(): void;
2460
+ /** Cancels recording, releases its capture stream, and rejects {@link result}. */
2461
+ cancel(reason?: unknown): void;
2462
+ private readonly onStart;
2463
+ private readonly onData;
2464
+ private readonly onStop;
2465
+ private readonly onError;
2466
+ private readonly onAbort;
2467
+ private readonly onTrackEnded;
2468
+ private cleanup;
2469
+ }
2470
+
2424
2471
  /** Container coordinates in GUI pixels. Crops refer to vanilla's 256×256 sheets; {@link GuiHelper.container} scales them for resource packs. */
2425
2472
  declare const GUI_CONTAINER_LAYOUTS: {
2426
2473
  readonly generic_54: {
@@ -2631,6 +2678,7 @@ declare class Renderer implements Disposable {
2631
2678
  private _running;
2632
2679
  private _inAnimationLoop;
2633
2680
  private _disposed;
2681
+ private _videoExporter?;
2634
2682
  private readonly _frameCallbacks;
2635
2683
  private readonly _debugHelpers;
2636
2684
  private readonly _eventDispatchers;
@@ -2660,9 +2708,9 @@ declare class Renderer implements Disposable {
2660
2708
  * Registering the same callback twice has no effect. Image exports do not invoke callbacks.
2661
2709
  */
2662
2710
  onFrame(callback: FrameCallback): () => void;
2663
- /** Starts or resumes the animation loop and registered frame callbacks. */
2711
+ /** Starts or resumes the animation loop and registered frame callbacks. Has no effect while running. */
2664
2712
  start(): void;
2665
- /** Pauses rendering and frame callbacks. Call {@link start} to resume. */
2713
+ /** Pauses rendering and frame callbacks, and cancels video export. Call {@link start} to resume. */
2666
2714
  stop(): void;
2667
2715
  /**
2668
2716
  * Stops rendering and releases owned resources. Repeated calls have no effect, and a disposed
@@ -2678,6 +2726,14 @@ declare class Renderer implements Disposable {
2678
2726
  * MIME type support and lossy quality (0–1) follow the canvas encoder.
2679
2727
  */
2680
2728
  toImage(trim?: boolean, mime?: string, quality?: number): string;
2729
+ /**
2730
+ * Records a silent browser video in real time, including frame callbacks and animated textures.
2731
+ * Keep the tab visible; browser scheduling and `render.fpsLimit` limit the capture rate.
2732
+ * The video keeps the initial drawing-buffer size and fills transparent pixels with black.
2733
+ * Temporarily starts a stopped renderer. Stop, disposal, or `options.signal` cancels the export.
2734
+ * Only one export can run at a time. Use the returned Blob's type to select a file extension.
2735
+ */
2736
+ toVideo(options: VideoExportOptions): Promise<Blob>;
2681
2737
  /** Exports visible scene meshes as OBJ text, without texture images. */
2682
2738
  toObj(): string;
2683
2739
  /** Exports visible scene meshes as PLY. Set `options.binary` for an ArrayBuffer. */
@@ -3299,4 +3355,4 @@ declare class NodeCache extends PersistentCache<LocalStorage> {
3299
3355
  forEach<T>(callback: (v: T, k: string) => void): Promise<void>;
3300
3356
  }
3301
3357
 
3302
- export { AXES, type AnimationFrame, type AnimationMeta, type AnimatorFunction, type AnvilChunk, AnvilParser, type AnvilRegion, ArchiveAssetSource, type ArchiveAssetSourceOptions, type ArchiveEntry, type ArchiveProxy, AssetKey, AssetLoadError, AssetLoader, AssetParser, AssetSource, type AssetType, Assets, Axis, BUILTIN_ENTITY, BUILTIN_GENERATED, type BannerPattern, type BannerPatternDraw, BannerPatterns, BasicAssetKey, type BasicMinecraftAsset, BatchedExecutor, type BedrockBone, type BedrockCube, type BedrockEntityDescription, type BedrockEntityFile, type BedrockGeometry, type BedrockGeometryFile, type BitmapFont, type BitmapGlyph, type Block, BlockEntities, type BlockEntityEntry, type BlockEntityIndex, type BlockEntityPart, type BlockEntityRotation, type BlockFluidState, type BlockInfo, type BlockModel, type BlockModelTextures, BlockObject, type BlockObjectOptions, type BlockState, type BlockStateMultipart, type BlockStateProperties, type BlockStateProperty, type BlockStatePropertyDefaults, type BlockStatePropertyValue, BlockStateResolver, type BlockStateVariant, type BlockStateVariants, BlockStates, BlockTints, type BoxGeometryKey, BrowserArchiveProxy, CUBE_FACES, CUBE_FACE_OFFSETS, type CacheKey, Caching, type CameraOptions, CanvasImage, type CapeLayout, Chunk, ChunkData, Colormaps, type CompatCanvas, type CompatImage, type ComposerOptions, type ControlsOptions, CubeFace, CubeFaceIndex, DEFAULT_ELEMENTS, DEFAULT_NAMESPACE, DEFAULT_ROOT, DEFAULT_UV, DISPLAY_POSITIONS, DYE_COLORS, type DebugOptions, type DeepPartial, DefaultBlockStates, DisplayPosition, DisplayTransforms, type Disposable, type DoubleArray, type DyeColor, ENTITY_ANIMATION_CHANNELS, type ElementFace, type ElementRotation, Entities, type EntityAnimation, type EntityAnimationBone, type EntityAnimationChannel, type EntityAnimationFile, type EntityAnimationKeyframe, type EntityAnimationOptions, EntityAnimationPlayer, type EntityAnimationPose, type EntityLayer, type EntityModel, type EntityModelCube, type EntityModelFile, type EntityModelLayer, type EntityModelOptions, type EntityModelPart, type EntityModelPass, EntityObject, type EntityObjectOptions, type EntityRenderMode, type EntityTransformOp, Env, type EnvProvider, type ExtractableImageData, type FluidKind, FluidModelObject, type FluidSample, type FluidSampler, Fonts, type FrameCallback, type FromTo, GUI_CONTAINER_LAYOUTS, Geometries, type GuiBookButtonState, type GuiBookOptions, type GuiBossBarColor, type GuiBossBarOptions, type GuiContainerType, GuiHelper, type GuiItemLayer, type GuiLayer, GuiLight, GuiObject, type GuiObjectOptions, type GuiRecipe, type GuiRecipeIngredient, type GuiRecipeOptions, type GuiSpriteScaling, type GuiText, type GuiTextLayer, type GuiTextLayout, type GuiTextOptions, type GuiTextRun, type GuiTextStyle, type GuiTextureLayer, type GuiTooltipOptions, HostedAssetSource, type IModelTextures, ITEM_GENERATED, type ImageInfo, ImageLoader, type ImageSizeInfo, InstanceManager, InstanceReference, type Instanceable, type ItemModel, type ItemModelContext, type ItemModelTextures, type ItemTintColor, type ItemTintSource, ItemTints, type ListAsset, type LoadedSceneDocument, type LoadedSceneObject, MapControls, type MaterialKey, Materials, type Maybe, type MeshKey, Meshes, MineRenderError, MineRenderScene, type MineRenderSceneOptions, MineRenderWorld, type MineRenderWorldOptions, type MinecraftAsset, MinecraftCubeTexture, MinecraftFaceUV, type MinecraftTextureMeta, type Model, ModelCulling, type ModelDisplay, type ModelElement, type ModelFaces, ModelGenerator, ModelMerger, ModelObject, type ModelObjectOptions, ModelTextures, Models, type MultiBlockBlock, type MultiBlockEntity, type MultiBlockStructure, type MultipartCondition, type NBTAsset, NBTHelper, NodeCache, NodeEnv, OrbitControls, type PackFormat, PackFormats, PackMetadata, PersistentCache, type PositionedGuiGlyph, type QuadArray, type RawImageKey, type RenderOptions, Renderer, type RendererFrame, type RendererOptions, type RequestConfig, RequestError, type RequestResponse, Requests, type ResolvedBlockEntity, type ResponseParser, SKIN_PARTS, type SceneBlockDefinition, type SceneDocument, SceneDocumentLoader, type SceneEntityDefinition, SceneExporter, type SceneGLTFExportOptions, type SceneGuiDefinition, type SceneGuiLayer, SceneInspector, type SceneModelDefinition, SceneObject, type SceneObjectDefinition, type SceneObjectDefinitionBase, type SceneObjectOptions, type SceneSkinDefinition, type SceneSkinPosePart, SceneStats, SceneStatsDisplay, SchematicParser, type SchematicParserOptions, SectionMesh, type SectionMeshEntry, type SectionMeshTemplate, SectionModels, type Serializable, type SkinGeometries, SkinImage, SkinObject, type SkinObjectOptions, SkinPart, type SkinTexture, type SkinTextureCoordinates, SkinTextures, Skins, type SpecialItemPart, type SpecialItemRenderer, SpecialItems, type StructureNBT, StructureParser, type TextureAsset, TextureAtlas, type TextureKey, TextureLoader, Textures, Ticker, type TickerFunction, TintColors, type Transformable, type TripleArray, UVMapper, WrappedImage, addBox3WireframeToObject, addWireframeToMesh, addWireframeToObject, applyElementRotation, applyGenericRotation, axisToVec3, base64decode, base64encode, capeTextureSizes, captureException, changeEvent, clampRotationDegrees, classicSkinGeometries, classicSkinTextureCoordinates, computeMorphedAttributes, createCanvas, createFluidGeometry, createGuiTextGeometry, createGuiTextureGeometry, createImage, entityAnimationTime, estimateBytesUsed, getBlockFluidState, getFluidKind, interleaveAttributes, isAssetKey, isBasicAssetKey, isBlockObject, isDisposable, isDoubleArray, isEntityObject, isGuiObject, isInstanceManager, isInstanceReference, isInstanceable, isInstancedMesh, isMesh, isMineRenderScene, isModelObject, isObject3D, isOrthographicCamera, isPerspectiveCamera, isQuadArray, isSceneObject, isTransformable, isTripleArray, isVector3, layoutGuiText, md5, mergeBufferAttributes, mergeBufferGeometries, mergeVertices, parseSceneDocument, prefix, registerNodeEnv, sampleEntityAnimation, sampleEntityKeyframes, sampleFluid, serializeBoxGeometryKey, serializeImageKey, serializeMaterialKey, serializeMeshKey, serializeTextureKey, sha1, sha256, sha512, shutdown, sleep, slimSkinGeometries, slimSkinTextureCoordinates, timingEnd, timingStart, toDegrees, toRadians, toTrianglesDrawMode, trimCanvas };
3358
+ export { AXES, type AnimationFrame, type AnimationMeta, type AnimatorFunction, type AnvilChunk, AnvilParser, type AnvilRegion, ArchiveAssetSource, type ArchiveAssetSourceOptions, type ArchiveEntry, type ArchiveProxy, AssetKey, AssetLoadError, AssetLoader, AssetParser, AssetSource, type AssetType, Assets, Axis, BUILTIN_ENTITY, BUILTIN_GENERATED, type BannerPattern, type BannerPatternDraw, BannerPatterns, BasicAssetKey, type BasicMinecraftAsset, BatchedExecutor, type BedrockBone, type BedrockCube, type BedrockEntityDescription, type BedrockEntityFile, type BedrockGeometry, type BedrockGeometryFile, type BitmapFont, type BitmapGlyph, type Block, BlockEntities, type BlockEntityEntry, type BlockEntityIndex, type BlockEntityPart, type BlockEntityRotation, type BlockFluidState, type BlockInfo, type BlockModel, type BlockModelTextures, BlockObject, type BlockObjectOptions, type BlockState, type BlockStateMultipart, type BlockStateProperties, type BlockStateProperty, type BlockStatePropertyDefaults, type BlockStatePropertyValue, BlockStateResolver, type BlockStateVariant, type BlockStateVariants, BlockStates, BlockTints, type BoxGeometryKey, BrowserArchiveProxy, CUBE_FACES, CUBE_FACE_OFFSETS, type CacheKey, Caching, type CameraOptions, CanvasImage, type CapeLayout, Chunk, ChunkData, Colormaps, type CompatCanvas, type CompatImage, type ComposerOptions, type ControlsOptions, CubeFace, CubeFaceIndex, DEFAULT_ELEMENTS, DEFAULT_NAMESPACE, DEFAULT_ROOT, DEFAULT_UV, DISPLAY_POSITIONS, DYE_COLORS, type DebugOptions, type DeepPartial, DefaultBlockStates, DisplayPosition, DisplayTransforms, type Disposable, type DoubleArray, type DyeColor, ENTITY_ANIMATION_CHANNELS, type ElementFace, type ElementRotation, Entities, type EntityAnimation, type EntityAnimationBone, type EntityAnimationChannel, type EntityAnimationFile, type EntityAnimationKeyframe, type EntityAnimationOptions, EntityAnimationPlayer, type EntityAnimationPose, type EntityLayer, type EntityModel, type EntityModelCube, type EntityModelFile, type EntityModelLayer, type EntityModelOptions, type EntityModelPart, type EntityModelPass, EntityObject, type EntityObjectOptions, type EntityRenderMode, type EntityTransformOp, Env, type EnvProvider, type ExtractableImageData, type FluidKind, FluidModelObject, type FluidSample, type FluidSampler, Fonts, type FrameCallback, type FromTo, GUI_CONTAINER_LAYOUTS, Geometries, type GuiBookButtonState, type GuiBookOptions, type GuiBossBarColor, type GuiBossBarOptions, type GuiContainerType, GuiHelper, type GuiItemLayer, type GuiLayer, GuiLight, GuiObject, type GuiObjectOptions, type GuiRecipe, type GuiRecipeIngredient, type GuiRecipeOptions, type GuiSpriteScaling, type GuiText, type GuiTextLayer, type GuiTextLayout, type GuiTextOptions, type GuiTextRun, type GuiTextStyle, type GuiTextureLayer, type GuiTooltipOptions, HostedAssetSource, type IModelTextures, ITEM_GENERATED, type ImageInfo, ImageLoader, type ImageSizeInfo, InstanceManager, InstanceReference, type Instanceable, type ItemModel, type ItemModelContext, type ItemModelTextures, type ItemTintColor, type ItemTintSource, ItemTints, type ListAsset, type LoadedSceneDocument, type LoadedSceneObject, MapControls, type MaterialKey, Materials, type Maybe, type MeshKey, Meshes, MineRenderError, MineRenderScene, type MineRenderSceneOptions, MineRenderWorld, type MineRenderWorldOptions, type MinecraftAsset, MinecraftCubeTexture, MinecraftFaceUV, type MinecraftTextureMeta, type Model, ModelCulling, type ModelDisplay, type ModelElement, type ModelFaces, ModelGenerator, ModelMerger, ModelObject, type ModelObjectOptions, ModelTextures, Models, type MultiBlockBlock, type MultiBlockEntity, type MultiBlockStructure, type MultipartCondition, type NBTAsset, NBTHelper, NodeCache, NodeEnv, OrbitControls, type PackFormat, PackFormats, PackMetadata, PersistentCache, type PositionedGuiGlyph, type QuadArray, type RawImageKey, type RenderOptions, Renderer, type RendererFrame, type RendererOptions, type RequestConfig, RequestError, type RequestResponse, Requests, type ResolvedBlockEntity, type ResponseParser, SKIN_PARTS, type SceneBlockDefinition, type SceneDocument, SceneDocumentLoader, type SceneEntityDefinition, SceneExporter, type SceneGLTFExportOptions, type SceneGuiDefinition, type SceneGuiLayer, SceneInspector, type SceneModelDefinition, SceneObject, type SceneObjectDefinition, type SceneObjectDefinitionBase, type SceneObjectOptions, type SceneSkinDefinition, type SceneSkinPosePart, SceneStats, SceneStatsDisplay, SchematicParser, type SchematicParserOptions, SectionMesh, type SectionMeshEntry, type SectionMeshTemplate, SectionModels, type Serializable, type SkinGeometries, SkinImage, SkinObject, type SkinObjectOptions, SkinPart, type SkinTexture, type SkinTextureCoordinates, SkinTextures, Skins, type SpecialItemPart, type SpecialItemRenderer, SpecialItems, type StructureNBT, StructureParser, type TextureAsset, TextureAtlas, type TextureKey, TextureLoader, Textures, Ticker, type TickerFunction, TintColors, type Transformable, type TripleArray, UVMapper, type VideoExportOptions, VideoExporter, WrappedImage, addBox3WireframeToObject, addWireframeToMesh, addWireframeToObject, applyElementRotation, applyGenericRotation, axisToVec3, base64decode, base64encode, capeTextureSizes, captureException, changeEvent, clampRotationDegrees, classicSkinGeometries, classicSkinTextureCoordinates, computeMorphedAttributes, createCanvas, createFluidGeometry, createGuiTextGeometry, createGuiTextureGeometry, createImage, entityAnimationTime, estimateBytesUsed, getBlockFluidState, getFluidKind, interleaveAttributes, isAssetKey, isBasicAssetKey, isBlockObject, isDisposable, isDoubleArray, isEntityObject, isGuiObject, isInstanceManager, isInstanceReference, isInstanceable, isInstancedMesh, isMesh, isMineRenderScene, isModelObject, isObject3D, isOrthographicCamera, isPerspectiveCamera, isQuadArray, isSceneObject, isTransformable, isTripleArray, isVector3, layoutGuiText, md5, mergeBufferAttributes, mergeBufferGeometries, mergeVertices, parseSceneDocument, prefix, registerNodeEnv, sampleEntityAnimation, sampleEntityKeyframes, sampleFluid, serializeBoxGeometryKey, serializeImageKey, serializeMaterialKey, serializeMeshKey, serializeTextureKey, sha1, sha256, sha512, shutdown, sleep, slimSkinGeometries, slimSkinTextureCoordinates, timingEnd, timingStart, toDegrees, toRadians, toTrianglesDrawMode, trimCanvas };
@@ -2421,6 +2421,53 @@ declare class SceneExporter {
2421
2421
  static toGLTF(root: Object3D, options?: SceneGLTFExportOptions): Promise<Record<string, any> | ArrayBuffer>;
2422
2422
  }
2423
2423
 
2424
+ /** Settings passed to {@link Renderer.toVideo}. */
2425
+ interface VideoExportOptions {
2426
+ /** Recording duration in seconds, greater than zero and at most 2147483.647. */
2427
+ duration: number;
2428
+ /** Requested capture rate (default 30). Rendering and browser scheduling can lower the actual rate. */
2429
+ fps?: number;
2430
+ /** Supported video MIME type. Defaults to WebM when available, then MP4. */
2431
+ mimeType?: string;
2432
+ /** Target video bitrate in bits per second, as a positive unsigned 32-bit integer. */
2433
+ videoBitsPerSecond?: number;
2434
+ /** Cancels recording and discards its output. */
2435
+ signal?: AbortSignal;
2436
+ }
2437
+ /**
2438
+ * Records fresh canvas frames in a browser, at a fixed size with an opaque black background.
2439
+ * @internal
2440
+ */
2441
+ declare class VideoExporter {
2442
+ private readonly source;
2443
+ /** Resolves after the recorder provides its final video data. */
2444
+ readonly result: Promise<Blob>;
2445
+ private readonly canvas;
2446
+ private readonly context;
2447
+ private readonly signal?;
2448
+ private readonly duration;
2449
+ private stream?;
2450
+ private recorder?;
2451
+ private timer?;
2452
+ private readonly chunks;
2453
+ private settled;
2454
+ private stopping;
2455
+ private resolve;
2456
+ private reject;
2457
+ constructor(source: HTMLCanvasElement, options: VideoExportOptions);
2458
+ /** Copies a freshly drawn source frame before WebGL can clear its drawing buffer. */
2459
+ capture(): void;
2460
+ /** Cancels recording, releases its capture stream, and rejects {@link result}. */
2461
+ cancel(reason?: unknown): void;
2462
+ private readonly onStart;
2463
+ private readonly onData;
2464
+ private readonly onStop;
2465
+ private readonly onError;
2466
+ private readonly onAbort;
2467
+ private readonly onTrackEnded;
2468
+ private cleanup;
2469
+ }
2470
+
2424
2471
  /** Container coordinates in GUI pixels. Crops refer to vanilla's 256×256 sheets; {@link GuiHelper.container} scales them for resource packs. */
2425
2472
  declare const GUI_CONTAINER_LAYOUTS: {
2426
2473
  readonly generic_54: {
@@ -2631,6 +2678,7 @@ declare class Renderer implements Disposable {
2631
2678
  private _running;
2632
2679
  private _inAnimationLoop;
2633
2680
  private _disposed;
2681
+ private _videoExporter?;
2634
2682
  private readonly _frameCallbacks;
2635
2683
  private readonly _debugHelpers;
2636
2684
  private readonly _eventDispatchers;
@@ -2660,9 +2708,9 @@ declare class Renderer implements Disposable {
2660
2708
  * Registering the same callback twice has no effect. Image exports do not invoke callbacks.
2661
2709
  */
2662
2710
  onFrame(callback: FrameCallback): () => void;
2663
- /** Starts or resumes the animation loop and registered frame callbacks. */
2711
+ /** Starts or resumes the animation loop and registered frame callbacks. Has no effect while running. */
2664
2712
  start(): void;
2665
- /** Pauses rendering and frame callbacks. Call {@link start} to resume. */
2713
+ /** Pauses rendering and frame callbacks, and cancels video export. Call {@link start} to resume. */
2666
2714
  stop(): void;
2667
2715
  /**
2668
2716
  * Stops rendering and releases owned resources. Repeated calls have no effect, and a disposed
@@ -2678,6 +2726,14 @@ declare class Renderer implements Disposable {
2678
2726
  * MIME type support and lossy quality (0–1) follow the canvas encoder.
2679
2727
  */
2680
2728
  toImage(trim?: boolean, mime?: string, quality?: number): string;
2729
+ /**
2730
+ * Records a silent browser video in real time, including frame callbacks and animated textures.
2731
+ * Keep the tab visible; browser scheduling and `render.fpsLimit` limit the capture rate.
2732
+ * The video keeps the initial drawing-buffer size and fills transparent pixels with black.
2733
+ * Temporarily starts a stopped renderer. Stop, disposal, or `options.signal` cancels the export.
2734
+ * Only one export can run at a time. Use the returned Blob's type to select a file extension.
2735
+ */
2736
+ toVideo(options: VideoExportOptions): Promise<Blob>;
2681
2737
  /** Exports visible scene meshes as OBJ text, without texture images. */
2682
2738
  toObj(): string;
2683
2739
  /** Exports visible scene meshes as PLY. Set `options.binary` for an ArrayBuffer. */
@@ -3299,4 +3355,4 @@ declare class NodeCache extends PersistentCache<LocalStorage> {
3299
3355
  forEach<T>(callback: (v: T, k: string) => void): Promise<void>;
3300
3356
  }
3301
3357
 
3302
- export { AXES, type AnimationFrame, type AnimationMeta, type AnimatorFunction, type AnvilChunk, AnvilParser, type AnvilRegion, ArchiveAssetSource, type ArchiveAssetSourceOptions, type ArchiveEntry, type ArchiveProxy, AssetKey, AssetLoadError, AssetLoader, AssetParser, AssetSource, type AssetType, Assets, Axis, BUILTIN_ENTITY, BUILTIN_GENERATED, type BannerPattern, type BannerPatternDraw, BannerPatterns, BasicAssetKey, type BasicMinecraftAsset, BatchedExecutor, type BedrockBone, type BedrockCube, type BedrockEntityDescription, type BedrockEntityFile, type BedrockGeometry, type BedrockGeometryFile, type BitmapFont, type BitmapGlyph, type Block, BlockEntities, type BlockEntityEntry, type BlockEntityIndex, type BlockEntityPart, type BlockEntityRotation, type BlockFluidState, type BlockInfo, type BlockModel, type BlockModelTextures, BlockObject, type BlockObjectOptions, type BlockState, type BlockStateMultipart, type BlockStateProperties, type BlockStateProperty, type BlockStatePropertyDefaults, type BlockStatePropertyValue, BlockStateResolver, type BlockStateVariant, type BlockStateVariants, BlockStates, BlockTints, type BoxGeometryKey, BrowserArchiveProxy, CUBE_FACES, CUBE_FACE_OFFSETS, type CacheKey, Caching, type CameraOptions, CanvasImage, type CapeLayout, Chunk, ChunkData, Colormaps, type CompatCanvas, type CompatImage, type ComposerOptions, type ControlsOptions, CubeFace, CubeFaceIndex, DEFAULT_ELEMENTS, DEFAULT_NAMESPACE, DEFAULT_ROOT, DEFAULT_UV, DISPLAY_POSITIONS, DYE_COLORS, type DebugOptions, type DeepPartial, DefaultBlockStates, DisplayPosition, DisplayTransforms, type Disposable, type DoubleArray, type DyeColor, ENTITY_ANIMATION_CHANNELS, type ElementFace, type ElementRotation, Entities, type EntityAnimation, type EntityAnimationBone, type EntityAnimationChannel, type EntityAnimationFile, type EntityAnimationKeyframe, type EntityAnimationOptions, EntityAnimationPlayer, type EntityAnimationPose, type EntityLayer, type EntityModel, type EntityModelCube, type EntityModelFile, type EntityModelLayer, type EntityModelOptions, type EntityModelPart, type EntityModelPass, EntityObject, type EntityObjectOptions, type EntityRenderMode, type EntityTransformOp, Env, type EnvProvider, type ExtractableImageData, type FluidKind, FluidModelObject, type FluidSample, type FluidSampler, Fonts, type FrameCallback, type FromTo, GUI_CONTAINER_LAYOUTS, Geometries, type GuiBookButtonState, type GuiBookOptions, type GuiBossBarColor, type GuiBossBarOptions, type GuiContainerType, GuiHelper, type GuiItemLayer, type GuiLayer, GuiLight, GuiObject, type GuiObjectOptions, type GuiRecipe, type GuiRecipeIngredient, type GuiRecipeOptions, type GuiSpriteScaling, type GuiText, type GuiTextLayer, type GuiTextLayout, type GuiTextOptions, type GuiTextRun, type GuiTextStyle, type GuiTextureLayer, type GuiTooltipOptions, HostedAssetSource, type IModelTextures, ITEM_GENERATED, type ImageInfo, ImageLoader, type ImageSizeInfo, InstanceManager, InstanceReference, type Instanceable, type ItemModel, type ItemModelContext, type ItemModelTextures, type ItemTintColor, type ItemTintSource, ItemTints, type ListAsset, type LoadedSceneDocument, type LoadedSceneObject, MapControls, type MaterialKey, Materials, type Maybe, type MeshKey, Meshes, MineRenderError, MineRenderScene, type MineRenderSceneOptions, MineRenderWorld, type MineRenderWorldOptions, type MinecraftAsset, MinecraftCubeTexture, MinecraftFaceUV, type MinecraftTextureMeta, type Model, ModelCulling, type ModelDisplay, type ModelElement, type ModelFaces, ModelGenerator, ModelMerger, ModelObject, type ModelObjectOptions, ModelTextures, Models, type MultiBlockBlock, type MultiBlockEntity, type MultiBlockStructure, type MultipartCondition, type NBTAsset, NBTHelper, NodeCache, NodeEnv, OrbitControls, type PackFormat, PackFormats, PackMetadata, PersistentCache, type PositionedGuiGlyph, type QuadArray, type RawImageKey, type RenderOptions, Renderer, type RendererFrame, type RendererOptions, type RequestConfig, RequestError, type RequestResponse, Requests, type ResolvedBlockEntity, type ResponseParser, SKIN_PARTS, type SceneBlockDefinition, type SceneDocument, SceneDocumentLoader, type SceneEntityDefinition, SceneExporter, type SceneGLTFExportOptions, type SceneGuiDefinition, type SceneGuiLayer, SceneInspector, type SceneModelDefinition, SceneObject, type SceneObjectDefinition, type SceneObjectDefinitionBase, type SceneObjectOptions, type SceneSkinDefinition, type SceneSkinPosePart, SceneStats, SceneStatsDisplay, SchematicParser, type SchematicParserOptions, SectionMesh, type SectionMeshEntry, type SectionMeshTemplate, SectionModels, type Serializable, type SkinGeometries, SkinImage, SkinObject, type SkinObjectOptions, SkinPart, type SkinTexture, type SkinTextureCoordinates, SkinTextures, Skins, type SpecialItemPart, type SpecialItemRenderer, SpecialItems, type StructureNBT, StructureParser, type TextureAsset, TextureAtlas, type TextureKey, TextureLoader, Textures, Ticker, type TickerFunction, TintColors, type Transformable, type TripleArray, UVMapper, WrappedImage, addBox3WireframeToObject, addWireframeToMesh, addWireframeToObject, applyElementRotation, applyGenericRotation, axisToVec3, base64decode, base64encode, capeTextureSizes, captureException, changeEvent, clampRotationDegrees, classicSkinGeometries, classicSkinTextureCoordinates, computeMorphedAttributes, createCanvas, createFluidGeometry, createGuiTextGeometry, createGuiTextureGeometry, createImage, entityAnimationTime, estimateBytesUsed, getBlockFluidState, getFluidKind, interleaveAttributes, isAssetKey, isBasicAssetKey, isBlockObject, isDisposable, isDoubleArray, isEntityObject, isGuiObject, isInstanceManager, isInstanceReference, isInstanceable, isInstancedMesh, isMesh, isMineRenderScene, isModelObject, isObject3D, isOrthographicCamera, isPerspectiveCamera, isQuadArray, isSceneObject, isTransformable, isTripleArray, isVector3, layoutGuiText, md5, mergeBufferAttributes, mergeBufferGeometries, mergeVertices, parseSceneDocument, prefix, registerNodeEnv, sampleEntityAnimation, sampleEntityKeyframes, sampleFluid, serializeBoxGeometryKey, serializeImageKey, serializeMaterialKey, serializeMeshKey, serializeTextureKey, sha1, sha256, sha512, shutdown, sleep, slimSkinGeometries, slimSkinTextureCoordinates, timingEnd, timingStart, toDegrees, toRadians, toTrianglesDrawMode, trimCanvas };
3358
+ export { AXES, type AnimationFrame, type AnimationMeta, type AnimatorFunction, type AnvilChunk, AnvilParser, type AnvilRegion, ArchiveAssetSource, type ArchiveAssetSourceOptions, type ArchiveEntry, type ArchiveProxy, AssetKey, AssetLoadError, AssetLoader, AssetParser, AssetSource, type AssetType, Assets, Axis, BUILTIN_ENTITY, BUILTIN_GENERATED, type BannerPattern, type BannerPatternDraw, BannerPatterns, BasicAssetKey, type BasicMinecraftAsset, BatchedExecutor, type BedrockBone, type BedrockCube, type BedrockEntityDescription, type BedrockEntityFile, type BedrockGeometry, type BedrockGeometryFile, type BitmapFont, type BitmapGlyph, type Block, BlockEntities, type BlockEntityEntry, type BlockEntityIndex, type BlockEntityPart, type BlockEntityRotation, type BlockFluidState, type BlockInfo, type BlockModel, type BlockModelTextures, BlockObject, type BlockObjectOptions, type BlockState, type BlockStateMultipart, type BlockStateProperties, type BlockStateProperty, type BlockStatePropertyDefaults, type BlockStatePropertyValue, BlockStateResolver, type BlockStateVariant, type BlockStateVariants, BlockStates, BlockTints, type BoxGeometryKey, BrowserArchiveProxy, CUBE_FACES, CUBE_FACE_OFFSETS, type CacheKey, Caching, type CameraOptions, CanvasImage, type CapeLayout, Chunk, ChunkData, Colormaps, type CompatCanvas, type CompatImage, type ComposerOptions, type ControlsOptions, CubeFace, CubeFaceIndex, DEFAULT_ELEMENTS, DEFAULT_NAMESPACE, DEFAULT_ROOT, DEFAULT_UV, DISPLAY_POSITIONS, DYE_COLORS, type DebugOptions, type DeepPartial, DefaultBlockStates, DisplayPosition, DisplayTransforms, type Disposable, type DoubleArray, type DyeColor, ENTITY_ANIMATION_CHANNELS, type ElementFace, type ElementRotation, Entities, type EntityAnimation, type EntityAnimationBone, type EntityAnimationChannel, type EntityAnimationFile, type EntityAnimationKeyframe, type EntityAnimationOptions, EntityAnimationPlayer, type EntityAnimationPose, type EntityLayer, type EntityModel, type EntityModelCube, type EntityModelFile, type EntityModelLayer, type EntityModelOptions, type EntityModelPart, type EntityModelPass, EntityObject, type EntityObjectOptions, type EntityRenderMode, type EntityTransformOp, Env, type EnvProvider, type ExtractableImageData, type FluidKind, FluidModelObject, type FluidSample, type FluidSampler, Fonts, type FrameCallback, type FromTo, GUI_CONTAINER_LAYOUTS, Geometries, type GuiBookButtonState, type GuiBookOptions, type GuiBossBarColor, type GuiBossBarOptions, type GuiContainerType, GuiHelper, type GuiItemLayer, type GuiLayer, GuiLight, GuiObject, type GuiObjectOptions, type GuiRecipe, type GuiRecipeIngredient, type GuiRecipeOptions, type GuiSpriteScaling, type GuiText, type GuiTextLayer, type GuiTextLayout, type GuiTextOptions, type GuiTextRun, type GuiTextStyle, type GuiTextureLayer, type GuiTooltipOptions, HostedAssetSource, type IModelTextures, ITEM_GENERATED, type ImageInfo, ImageLoader, type ImageSizeInfo, InstanceManager, InstanceReference, type Instanceable, type ItemModel, type ItemModelContext, type ItemModelTextures, type ItemTintColor, type ItemTintSource, ItemTints, type ListAsset, type LoadedSceneDocument, type LoadedSceneObject, MapControls, type MaterialKey, Materials, type Maybe, type MeshKey, Meshes, MineRenderError, MineRenderScene, type MineRenderSceneOptions, MineRenderWorld, type MineRenderWorldOptions, type MinecraftAsset, MinecraftCubeTexture, MinecraftFaceUV, type MinecraftTextureMeta, type Model, ModelCulling, type ModelDisplay, type ModelElement, type ModelFaces, ModelGenerator, ModelMerger, ModelObject, type ModelObjectOptions, ModelTextures, Models, type MultiBlockBlock, type MultiBlockEntity, type MultiBlockStructure, type MultipartCondition, type NBTAsset, NBTHelper, NodeCache, NodeEnv, OrbitControls, type PackFormat, PackFormats, PackMetadata, PersistentCache, type PositionedGuiGlyph, type QuadArray, type RawImageKey, type RenderOptions, Renderer, type RendererFrame, type RendererOptions, type RequestConfig, RequestError, type RequestResponse, Requests, type ResolvedBlockEntity, type ResponseParser, SKIN_PARTS, type SceneBlockDefinition, type SceneDocument, SceneDocumentLoader, type SceneEntityDefinition, SceneExporter, type SceneGLTFExportOptions, type SceneGuiDefinition, type SceneGuiLayer, SceneInspector, type SceneModelDefinition, SceneObject, type SceneObjectDefinition, type SceneObjectDefinitionBase, type SceneObjectOptions, type SceneSkinDefinition, type SceneSkinPosePart, SceneStats, SceneStatsDisplay, SchematicParser, type SchematicParserOptions, SectionMesh, type SectionMeshEntry, type SectionMeshTemplate, SectionModels, type Serializable, type SkinGeometries, SkinImage, SkinObject, type SkinObjectOptions, SkinPart, type SkinTexture, type SkinTextureCoordinates, SkinTextures, Skins, type SpecialItemPart, type SpecialItemRenderer, SpecialItems, type StructureNBT, StructureParser, type TextureAsset, TextureAtlas, type TextureKey, TextureLoader, Textures, Ticker, type TickerFunction, TintColors, type Transformable, type TripleArray, UVMapper, type VideoExportOptions, VideoExporter, WrappedImage, addBox3WireframeToObject, addWireframeToMesh, addWireframeToObject, applyElementRotation, applyGenericRotation, axisToVec3, base64decode, base64encode, capeTextureSizes, captureException, changeEvent, clampRotationDegrees, classicSkinGeometries, classicSkinTextureCoordinates, computeMorphedAttributes, createCanvas, createFluidGeometry, createGuiTextGeometry, createGuiTextureGeometry, createImage, entityAnimationTime, estimateBytesUsed, getBlockFluidState, getFluidKind, interleaveAttributes, isAssetKey, isBasicAssetKey, isBlockObject, isDisposable, isDoubleArray, isEntityObject, isGuiObject, isInstanceManager, isInstanceReference, isInstanceable, isInstancedMesh, isMesh, isMineRenderScene, isModelObject, isObject3D, isOrthographicCamera, isPerspectiveCamera, isQuadArray, isSceneObject, isTransformable, isTripleArray, isVector3, layoutGuiText, md5, mergeBufferAttributes, mergeBufferGeometries, mergeVertices, parseSceneDocument, prefix, registerNodeEnv, sampleEntityAnimation, sampleEntityKeyframes, sampleFluid, serializeBoxGeometryKey, serializeImageKey, serializeMaterialKey, serializeMeshKey, serializeTextureKey, sha1, sha256, sha512, shutdown, sleep, slimSkinGeometries, slimSkinTextureCoordinates, timingEnd, timingStart, toDegrees, toRadians, toTrianglesDrawMode, trimCanvas };
@@ -18882,6 +18882,7 @@ __export(index_node_exports, {
18882
18882
  Ticker: () => Ticker,
18883
18883
  TintColors: () => TintColors,
18884
18884
  UVMapper: () => UVMapper,
18885
+ VideoExporter: () => VideoExporter,
18885
18886
  WrappedImage: () => WrappedImage,
18886
18887
  addBox3WireframeToObject: () => addBox3WireframeToObject,
18887
18888
  addWireframeToMesh: () => addWireframeToMesh,
@@ -22218,6 +22219,131 @@ function copyDataTexture(source) {
22218
22219
  return new import_three19.Texture().copy(copySource);
22219
22220
  }
22220
22221
 
22222
+ // src/export/VideoExporter.ts
22223
+ var VideoExporter = class {
22224
+ constructor(source, options) {
22225
+ this.source = source;
22226
+ this.chunks = [];
22227
+ this.settled = false;
22228
+ this.stopping = false;
22229
+ this.onStart = () => {
22230
+ this.timer = setTimeout(() => {
22231
+ this.stopping = true;
22232
+ try {
22233
+ this.recorder.stop();
22234
+ } catch (error) {
22235
+ this.cancel(error);
22236
+ }
22237
+ }, this.duration * 1e3);
22238
+ };
22239
+ this.onData = (event) => {
22240
+ if (event.data.size) this.chunks.push(event.data);
22241
+ };
22242
+ this.onStop = () => {
22243
+ if (!this.stopping) return this.cancel(new Error("Video recording stopped before its duration elapsed"));
22244
+ if (!this.chunks.length) return this.cancel(new Error("The browser produced no video data"));
22245
+ const mimeType = this.chunks.find((chunk) => chunk.type)?.type || this.recorder.mimeType;
22246
+ const blob = new Blob(this.chunks, { type: mimeType });
22247
+ this.settled = true;
22248
+ this.cleanup();
22249
+ this.resolve(blob);
22250
+ };
22251
+ this.onError = (event) => {
22252
+ this.cancel(event.error ?? new Error("Video recording failed"));
22253
+ };
22254
+ this.onAbort = () => {
22255
+ this.cancel(this.signal.reason);
22256
+ };
22257
+ this.onTrackEnded = () => {
22258
+ this.cancel(new Error("The video capture stream stopped producing frames"));
22259
+ };
22260
+ const fps = options.fps ?? 30;
22261
+ if (!Number.isFinite(options.duration) || options.duration <= 0 || options.duration * 1e3 > 2147483647) {
22262
+ throw new RangeError("Video duration must be greater than zero and at most 2147483.647 seconds");
22263
+ }
22264
+ if (!Number.isFinite(fps) || fps <= 0) throw new RangeError("Video fps must be a finite positive number");
22265
+ const bitrate = options.videoBitsPerSecond;
22266
+ if (bitrate !== void 0 && (!Number.isInteger(bitrate) || bitrate <= 0 || bitrate > 4294967295)) {
22267
+ throw new RangeError("Video bitrate must be a positive unsigned 32-bit integer");
22268
+ }
22269
+ if (!source.width || !source.height) throw new Error("Cannot export video from an empty canvas");
22270
+ options.signal?.throwIfAborted();
22271
+ if (typeof document === "undefined" || typeof MediaRecorder === "undefined" || typeof MediaRecorder.isTypeSupported !== "function") {
22272
+ throw new Error("Video export requires a browser with MediaRecorder support");
22273
+ }
22274
+ const mimeTypes = options.mimeType === void 0 ? ["video/webm;codecs=vp9", "video/webm;codecs=vp8", "video/webm", "video/mp4"] : [options.mimeType];
22275
+ const mimeType = mimeTypes.find((type) => type.startsWith("video/") && MediaRecorder.isTypeSupported(type));
22276
+ if (!mimeType) throw new Error("The browser does not support the requested video format");
22277
+ this.canvas = document.createElement("canvas");
22278
+ this.canvas.width = source.width;
22279
+ this.canvas.height = source.height;
22280
+ if (typeof this.canvas.captureStream !== "function") throw new Error("Video export requires canvas captureStream support");
22281
+ const context = this.canvas.getContext("2d", { alpha: false });
22282
+ if (!context) throw new Error("Could not create a canvas for video export");
22283
+ this.context = context;
22284
+ this.signal = options.signal;
22285
+ this.duration = options.duration;
22286
+ this.result = new Promise((resolve, reject) => {
22287
+ this.resolve = resolve;
22288
+ this.reject = reject;
22289
+ });
22290
+ try {
22291
+ this.stream = this.canvas.captureStream(fps);
22292
+ this.recorder = new MediaRecorder(this.stream, { mimeType, videoBitsPerSecond: bitrate });
22293
+ this.recorder.addEventListener("start", this.onStart);
22294
+ this.recorder.addEventListener("dataavailable", this.onData);
22295
+ this.recorder.addEventListener("stop", this.onStop);
22296
+ this.recorder.addEventListener("error", this.onError);
22297
+ for (const track of this.stream.getTracks()) {
22298
+ track.addEventListener("ended", this.onTrackEnded);
22299
+ }
22300
+ this.signal?.addEventListener("abort", this.onAbort, { once: true });
22301
+ this.recorder.start();
22302
+ } catch (error) {
22303
+ this.cancel(error);
22304
+ }
22305
+ }
22306
+ /** Copies a freshly drawn source frame before WebGL can clear its drawing buffer. */
22307
+ capture() {
22308
+ if (this.settled || this.stopping) return;
22309
+ try {
22310
+ this.context.fillStyle = "#000000";
22311
+ this.context.fillRect(0, 0, this.canvas.width, this.canvas.height);
22312
+ this.context.drawImage(this.source, 0, 0, this.canvas.width, this.canvas.height);
22313
+ } catch (error) {
22314
+ this.cancel(error);
22315
+ }
22316
+ }
22317
+ /** Cancels recording, releases its capture stream, and rejects {@link result}. */
22318
+ cancel(reason = new DOMException("Video export cancelled", "AbortError")) {
22319
+ if (this.settled) return;
22320
+ this.settled = true;
22321
+ this.cleanup();
22322
+ this.reject(reason);
22323
+ }
22324
+ cleanup() {
22325
+ if (this.timer !== void 0) clearTimeout(this.timer);
22326
+ this.signal?.removeEventListener("abort", this.onAbort);
22327
+ if (this.recorder) {
22328
+ this.recorder.removeEventListener("start", this.onStart);
22329
+ this.recorder.removeEventListener("dataavailable", this.onData);
22330
+ this.recorder.removeEventListener("stop", this.onStop);
22331
+ this.recorder.removeEventListener("error", this.onError);
22332
+ if (this.recorder.state !== "inactive") {
22333
+ try {
22334
+ this.recorder.stop();
22335
+ } catch {
22336
+ }
22337
+ }
22338
+ }
22339
+ for (const track of this.stream?.getTracks() ?? []) {
22340
+ track.removeEventListener("ended", this.onTrackEnded);
22341
+ track.stop();
22342
+ }
22343
+ this.chunks.length = 0;
22344
+ }
22345
+ };
22346
+
22221
22347
  // src/gui/GuiHelper.ts
22222
22348
  init_AssetKey();
22223
22349
  init_ModelTextures();
@@ -27529,6 +27655,9 @@ var Renderer = class _Renderer {
27529
27655
  this._inAnimationLoop = true;
27530
27656
  try {
27531
27657
  this.animate(time);
27658
+ } catch (error) {
27659
+ this._videoExporter?.cancel(error);
27660
+ throw error;
27532
27661
  } finally {
27533
27662
  this._inAnimationLoop = false;
27534
27663
  }
@@ -27763,16 +27892,18 @@ var Renderer = class _Renderer {
27763
27892
  if (this._frameCallbacks.get(callback) === subscription) this._frameCallbacks.delete(callback);
27764
27893
  };
27765
27894
  }
27766
- /** Starts or resumes the animation loop and registered frame callbacks. */
27895
+ /** Starts or resumes the animation loop and registered frame callbacks. Has no effect while running. */
27767
27896
  start() {
27768
- if (this._disposed) return;
27897
+ if (this._disposed || this._running) return;
27769
27898
  this.stop();
27770
27899
  this._running = true;
27771
27900
  if (!this._inAnimationLoop) this.renderer.setAnimationLoop(this._animationLoop);
27772
27901
  }
27773
- /** Pauses rendering and frame callbacks. Call {@link start} to resume. */
27902
+ /** Pauses rendering and frame callbacks, and cancels video export. Call {@link start} to resume. */
27774
27903
  stop() {
27775
27904
  if (this._disposed) return;
27905
+ this._videoExporter?.cancel();
27906
+ this._videoExporter = void 0;
27776
27907
  this._running = false;
27777
27908
  if (this._inAnimationLoop) {
27778
27909
  queueMicrotask(() => {
@@ -27834,7 +27965,7 @@ var Renderer = class _Renderer {
27834
27965
  this._controls.update();
27835
27966
  }
27836
27967
  if (!this._running) return;
27837
- if (!this.dirty && !this.options.render.renderAlways && !this._frameCallbacks.size) return;
27968
+ if (!this.dirty && !this.options.render.renderAlways && !this._frameCallbacks.size && !this._videoExporter) return;
27838
27969
  const interval = this._frameInterval;
27839
27970
  if (interval) {
27840
27971
  const next = this._nextFrameTime;
@@ -27859,6 +27990,7 @@ var Renderer = class _Renderer {
27859
27990
  } else {
27860
27991
  this.renderer.render(this.scene, this.camera);
27861
27992
  }
27993
+ this._videoExporter?.capture();
27862
27994
  this.dirty = false;
27863
27995
  if (this._stats) {
27864
27996
  this._stats.end();
@@ -27879,6 +28011,35 @@ var Renderer = class _Renderer {
27879
28011
  const canvas = trim ? trimCanvas(this.renderer.domElement) : this.renderer.domElement;
27880
28012
  return canvas.toDataURL(mime, quality);
27881
28013
  }
28014
+ /**
28015
+ * Records a silent browser video in real time, including frame callbacks and animated textures.
28016
+ * Keep the tab visible; browser scheduling and `render.fpsLimit` limit the capture rate.
28017
+ * The video keeps the initial drawing-buffer size and fills transparent pixels with black.
28018
+ * Temporarily starts a stopped renderer. Stop, disposal, or `options.signal` cancels the export.
28019
+ * Only one export can run at a time. Use the returned Blob's type to select a file extension.
28020
+ */
28021
+ async toVideo(options) {
28022
+ if (this._disposed) throw new Error("Cannot export a video from a disposed renderer");
28023
+ if (this._videoExporter) throw new Error("A video export is already running");
28024
+ const exporter = new VideoExporter(this.renderer.domElement, options);
28025
+ const wasRunning = this._running;
28026
+ try {
28027
+ try {
28028
+ if (!wasRunning) this.start();
28029
+ this._videoExporter = exporter;
28030
+ if (this._controls?.enabled) this._controls.update();
28031
+ this.drawFrame();
28032
+ } catch (error) {
28033
+ exporter.cancel(error);
28034
+ }
28035
+ return await exporter.result;
28036
+ } finally {
28037
+ if (this._videoExporter === exporter) {
28038
+ this._videoExporter = void 0;
28039
+ if (!wasRunning) this.stop();
28040
+ }
28041
+ }
28042
+ }
27882
28043
  /** Exports visible scene meshes as OBJ text, without texture images. */
27883
28044
  toObj() {
27884
28045
  return SceneExporter.toObj(this.scene);
@@ -29571,6 +29732,7 @@ var Chunk = class _Chunk {
29571
29732
  Ticker,
29572
29733
  TintColors,
29573
29734
  UVMapper,
29735
+ VideoExporter,
29574
29736
  WrappedImage,
29575
29737
  addBox3WireframeToObject,
29576
29738
  addWireframeToMesh,