Skip to main content

Interface: PlayerOptions

Defined in: src/player/Player.ts:38

Options for configuring a ThreeDScene.

Extends​

Properties​

allowExport?​

optional allowExport: boolean

Defined in: src/player/Player.ts:57

Show the export (GIF / WebM / MP4) button. Set false for embeds that cannot download files. exportAs() still works from code. Default true.


allowFullscreen?​

optional allowFullscreen: boolean

Defined in: src/player/Player.ts:52

Show the fullscreen button and enable the F shortcut. Set false for sandboxed embeds without fullscreen permission. Default true.


antialias?​

optional antialias: boolean

Defined in: src/core/Scene.ts:89

Multisample antialiasing. Turning it off roughly halves GPU fill cost on low-end and mobile GPUs, at the price of slightly jagged edges. Defaults to true.

Inherited from​

ThreeDSceneOptions.antialias


autoHideMs?​

optional autoHideMs: number

Defined in: src/player/Player.ts:59

Auto-hide controls after this many ms. 0 = never. Default 2500.


autoPlay?​

optional autoPlay: boolean

Defined in: src/player/Player.ts:61

Auto-play after sequence() finishes recording. Default false.


autoRender?​

optional autoRender: boolean

Defined in: src/core/Scene.ts:72

Enable auto-render on add/remove. Defaults to true.

Inherited from​

ThreeDSceneOptions.autoRender


autoResize?​

optional autoResize: boolean

Defined in: src/core/Scene.ts:83

Automatically resize the canvas when its container (or the window, on mobile rotation) changes size. Only active when both width and height are omitted — passing either dimension is treated as a request for a pinned canvas size, so auto-resize stays off. Defaults to true.

Inherited from​

ThreeDSceneOptions.autoResize


backgroundColor?​

optional backgroundColor: string

Defined in: src/core/Scene.ts:62

Background color as CSS color string. Defaults to Manim's dark gray (#1C1C1C).

Inherited from​

ThreeDSceneOptions.backgroundColor


backgroundOpacity?​

optional backgroundOpacity: number

Defined in: src/core/Scene.ts:74

Background opacity (0 = fully transparent, 1 = fully opaque). Defaults to 1. Not supported when exporting to video or GIF formats.

Inherited from​

ThreeDSceneOptions.backgroundOpacity


distance?​

optional distance: number

Defined in: src/core/ThreeDScene.ts:103

Initial camera distance from origin. Defaults to 15.

Inherited from​

ThreeDSceneOptions.distance


enableOrbitControls?​

optional enableOrbitControls: boolean

Defined in: src/core/ThreeDScene.ts:105

Enable orbit controls for user interaction. Defaults to true.

Inherited from​

ThreeDSceneOptions.enableOrbitControls


exportControls?​

optional exportControls: boolean

Defined in: src/player/Player.ts:77

Show an fps/resolution/quality panel in the export menu, so viewers can pick export settings without subclassing the Player. Default false.


fov?​

optional fov: number

Defined in: src/core/ThreeDScene.ts:97

Camera field of view in degrees. Defaults to 45.

Inherited from​

ThreeDSceneOptions.fov


frameHeight?​

optional frameHeight: number

Defined in: src/core/Scene.ts:66

Frame height in world units. Defaults to 8 (Manim standard).

Inherited from​

ThreeDSceneOptions.frameHeight


frameWidth?​

optional frameWidth: number

Defined in: src/core/Scene.ts:64

Frame width in world units. Defaults to 14 (Manim standard).

Inherited from​

ThreeDSceneOptions.frameWidth


frustumCulling?​

optional frustumCulling: boolean

Defined in: src/core/Scene.ts:70

Enable frustum culling optimization. Defaults to true.

Inherited from​

ThreeDSceneOptions.frustumCulling


headless?​

optional headless: boolean

Defined in: src/core/Scene.ts:76

Enable headless mode (no WebGL renderer). Useful for testing scene logic without a DOM.

Inherited from​

ThreeDSceneOptions.headless


height?​

optional height: number

Defined in: src/core/Scene.ts:60

Canvas height in pixels. Defaults to container height.

Inherited from​

ThreeDSceneOptions.height


interactiveSlides?​

optional interactiveSlides: boolean

Defined in: src/player/Player.ts:72

Keep the scene interactive while paused. When true, a Draggable, Clickable or Hoverable object responds on a paused slide: a pointer event triggers one scene render without advancing the timeline. Default false, so normal slides keep their cheap paused behavior (no extra renders).


loop?​

optional loop: boolean

Defined in: src/player/Player.ts:63

Loop playback. Default false.


orbitControlsOptions?​

optional orbitControlsOptions: OrbitControlsOptions

Defined in: src/core/ThreeDScene.ts:109

Orbit controls configuration options.

Inherited from​

ThreeDSceneOptions.orbitControlsOptions


orbitControlsUp?​

optional orbitControlsUp: "x" | "y" | "z"

Defined in: src/core/ThreeDScene.ts:107

Vertical rotation axis for orbit controls: 'x', 'y', or 'z'. If not provided, camera.up is computed from initial phi/theta via orbit() formula.

Inherited from​

ThreeDSceneOptions.orbitControlsUp


pauseRenderingWhenHidden?​

optional pauseRenderingWhenHidden: boolean

Defined in: src/core/Scene.ts:111

Skip drawing animation frames while the canvas is scrolled out of view or its tab is hidden. Animations and updaters keep running, and the current frame is drawn as soon as the canvas is visible again. Explicit renders (render(), seek(), exports) always draw. Defaults to true.

Inherited from​

ThreeDSceneOptions.pauseRenderingWhenHidden


phi?​

optional phi: number

Defined in: src/core/ThreeDScene.ts:99

Initial camera phi angle (polar, from Y axis). Defaults to PI/4.

Inherited from​

ThreeDSceneOptions.phi


pixelRatio?​

optional pixelRatio: number

Defined in: src/core/Scene.ts:95

Canvas resolution multiplier. Defaults to window.devicePixelRatio, capped at 2. Pass 1 on high-DPI phones and low-end laptops to draw a quarter of the pixels at 2x DPR.

Inherited from​

ThreeDSceneOptions.pixelRatio


powerPreference?​

optional powerPreference: "default" | "high-performance" | "low-power"

Defined in: src/core/Scene.ts:97

GPU power hint passed to WebGL. Defaults to 'high-performance'.

Inherited from​

ThreeDSceneOptions.powerPreference


preserveDrawingBuffer?​

optional preserveDrawingBuffer: boolean

Defined in: src/core/Scene.ts:104

Keep the drawing buffer after compositing. Exporters that read the canvas asynchronously (PNG export via toBlob, for example) need it, so leave it on for scenes you export. For playback-only scenes, turning it off saves a per-frame buffer copy on many GPUs. Defaults to true.

Inherited from​

ThreeDSceneOptions.preserveDrawingBuffer


setupLighting?​

optional setupLighting: boolean

Defined in: src/core/ThreeDScene.ts:111

Whether to set up default lighting. Defaults to true.

Inherited from​

ThreeDSceneOptions.setupLighting


slidesMode?​

optional slidesMode: boolean

Defined in: src/player/Player.ts:65

Slides mode: arrows play/pause at slide boundaries like a presentation. Default false.


targetFps?​

optional targetFps: number

Defined in: src/core/Scene.ts:68

Target frame rate in fps. Defaults to 60.

Inherited from​

ThreeDSceneOptions.targetFps


theta?​

optional theta: number

Defined in: src/core/ThreeDScene.ts:101

Initial camera theta angle (azimuthal, in XZ plane). Defaults to -PI/4.

Inherited from​

ThreeDSceneOptions.theta


threeD?​

optional threeD: boolean

Defined in: src/player/Player.ts:47

Render 3D content (Molecule3D, Protein, Surface3D, ...). When true, the Player creates a ThreeDScene: perspective camera, depth testing and default lighting. The ThreeDScene options (phi, theta, distance, fov, setupLighting, ...) apply only in this mode. Orbit controls are off unless enableOrbitControls: true, because a canvas drag would also toggle play/pause. Default false (a 2D Scene).


width?​

optional width: number

Defined in: src/core/Scene.ts:58

Canvas width in pixels. Defaults to container width.

Inherited from​

ThreeDSceneOptions.width