@rendley/sdk - v1.15.19
    Preparing search index...

    Class Engine

    Main SDK entrypoint for project editing, playback, serialization, and export.

    The engine coordinates the display, timeline, library, storage, subtitles, rendering, and media-processing subsystems behind a single singleton instance.

    Index

    Properties

    customClipTypes: Map<string, CustomClipConstructor<CustomClip>> = ...
    events: EventEmitter
    currentVersion: string = __APP_VERSION__
    projectVersion: string = ...

    Methods

    • Invokes a static method on a previously registered custom clip type.

      Parameters

      • typeEnum: string

        Registered custom clip type to target.

      • methodName: string

        Static method name to invoke.

      • ...args: any[]

        Arguments forwarded to the static method.

      Returns any

      The value returned by the static method.

    • Cancels the active export, if one is currently running.

      Returns Promise<void>

      A promise that resolves after cancellation has been propagated to the renderer.

    • Removes all custom metadata entries from the engine.

      Returns void

      Nothing.

    • Creates an instance of a registered custom clip type.

      Type Parameters

      Parameters

      • typeEnum: string

        Registered custom clip type to instantiate.

      • ...args: any[]

        Arguments forwarded to the custom clip constructor.

      Returns T

      The created custom clip instance.

    • Destroys the current engine state and releases runtime resources.

      Parameters

      • Optionaleverything: boolean

        When true, also destroys long-lived singletons such as display, renderer, FFmpeg, and font registry, and clears the engine singleton reference.

      Returns Promise<void>

      A promise that resolves after teardown finishes.

    • Exports the current project using the supplied export settings.

      Parameters

      • Optionalpayload: ExportOptions

        Export configuration describing output type, time range, resolution scale, and audio format.

      Returns Promise<null | ExportResult>

      A promise that resolves to the exported artifact, or null when no file is produced.

    • Exports an audio-only mix for the requested timeline range.

      Parameters

      • payload: AudioRangeExportOptions

        Audio export configuration, including the exported range and optional clip filtering.

      Returns Promise<null | ExportResult>

      A promise that resolves to the exported audio artifact, or null when no file is produced.

    • Returns a copy of the engine's custom metadata.

      Returns undefined | Map<string, unknown>

      A new metadata map, or undefined when no custom metadata has been set.

    • Returns the shared audio mixer that routes clip audio through gain nodes.

      Returns AudioMixer

      The engine audio mixer.

    • Returns the background timer used for deferred work while the page is inactive.

      Returns BackgroundTimer

      The engine background timer.

    • Looks up a clip by its timeline identifier.

      Parameters

      • clipId: string

        Clip identifier to resolve.

      Returns undefined | Clip<Sprite, ClipStyle<Sprite>>

      The matching clip, or undefined if no clip exists for that ID.

    • Returns the IDs of clips intersecting the supplied canvas coordinates.

      This method is currently a placeholder and always returns null.

      Parameters

      • x: number

        Horizontal coordinate in canvas space.

      • y: number

        Vertical coordinate in canvas space.

      Returns null

      null.

    • Reads a custom metadata value previously stored on the engine.

      Parameters

      • key: string

        Metadata key to read.

      Returns unknown

      The stored value, or undefined if the key is not present.

    • Returns the custom media hash function configured during initialization.

      Returns undefined | ((data: Uint8Array) => Promise<string>)

      The custom hash function, or undefined when the default behavior is used.

    • Returns the display controller used to render the project canvas.

      Returns Display

      The engine display.

    • Returns the low-level FFmpeg instance used by the SDK.

      Returns FFmpeg

      The initialized FFmpeg bridge.

    • Returns the font registry used by text and HTML clips.

      Returns FontRegistry

      The font registry.

    • Captures a rendered frame as a base64-encoded image.

      If time is provided, the timeline is temporarily seeked before capture and then restored.

      Parameters

      • Optionaltime: number

        Optional timeline time, in seconds, to capture.

      • mimeType: "image/png" | "image/jpeg" | "image/webp" = "image/png"

        Image MIME type used for encoding.

      • quality: number = 0.92

        Encoder quality passed to PIXI extraction for lossy formats.

      Returns Promise<string>

      A promise that resolves to a base64 image string, or an empty string when no renderer is available.

    • Captures a rendered frame as raw RGBA pixels without image encoding.

      The optional region uses composition coordinates and is clipped to the display bounds. If time is provided, the timeline is temporarily seeked before capture and then restored.

      Parameters

      • Optionaltime: number

        Optional timeline time, in seconds, to capture.

      • Optionalregion: FramePixelRegion

        Optional composition-space region. The full display is captured when omitted.

      Returns Promise<null | FramePixelData>

      Raw RGBA data and the actual captured rectangle, or null when it cannot be captured.

    • Returns the library that owns imported media, effects, filters, transitions, and subtitles.

      Returns Library

      The project library.

    • Returns the background media hash service (see Settings::setMediaBackgroundHashing).

      Returns MediaHashService

      The engine-owned media hash service.

    • Returns the pooled media info probing service (see Settings::setMediaInfoMaxWorkers).

      Returns MediaInfoService

      The engine-owned media info service.

    • Returns the pooled media transcoding service (see Settings::setMediaTranscodeMaxWorkers).

      Returns MediaTranscodeService

      The engine-owned media transcode service.

    • Returns the identifier of the active project.

      Returns string

      The current project ID.

    • Returns the renderer currently backing the engine display.

      Returns PixiRenderer

      The active PIXI renderer wrapper.

    • Returns the project settings currently applied by the engine.

      Returns Settings

      The active settings instance.

    • Returns the subtitles manager used for subtitle track styling and playback.

      Returns SubtitlesManager

      The subtitles manager.

    • Returns the timeline managed by the engine.

      Returns Timeline

      The project timeline.

    • Returns the optional transcode provider configured for this engine.

      Returns null | ITranscodeProvider

      The transcode provider, or null when transcoding is not configured.

    • Returns the undo manager associated with the engine.

      Returns UndoManager

      The undo manager.

    • Checks whether a custom clip type has been registered.

      Parameters

      • typeEnum: string

        Clip type identifier to test.

      Returns boolean

      true if the custom clip type exists; otherwise false.

    • Checks whether a custom metadata entry exists.

      Parameters

      • key: string

        Metadata key to check.

      Returns boolean

      true if the key exists; otherwise false.

    • Indicates whether the engine singleton has already been created.

      Returns boolean

      true if an engine instance already exists; otherwise false.

    • Initializes the engine and all configured subsystems.

      This sets up display, FFmpeg, storage, library state, timeline state, licensing, and optional transcoding support.

      Parameters

      Returns Promise<void>

      A promise that resolves after initialization has completed.

    • Probes whether exporting through the WebCodecs encoding path is supported with the current encoder configuration, and reports the full capability surface: per-codec support, bitrate modes (constant/variable), hardware acceleration, a standard resolution ladder, and the supported bitrate interval.

      The overall supported flag reproduces the export pipeline's runtime fallback ladder for the active (possibly user-forced) codec, so it answers "would an export started right now find a usable encoder configuration". Pass dryRun: true to additionally verify the selected configuration by actually encoding a few synthetic frames through a real VideoEncoder — the definitive check for encoders that claim support but fail once configured. See ExportSupportInfo.

      Parameters

      • Optionaloptions: ExportSupportProbeOptions

        Optional overrides (width/height/framerate/bitrate, dryRun); every omitted value defaults to the engine's current export configuration.

      Returns Promise<ExportSupportInfo>

      A promise resolving to the capability report.

    • Indicates whether init() has completed successfully for this engine instance.

      Returns boolean

      true if the engine has been initialized; otherwise false.

    • Indicates whether the engine is ready for playback, editing, and rendering work.

      Returns boolean

      true if initialization has completed and the engine is ready; otherwise false.

    • Indicates whether preview rendering or export rendering is currently running.

      Returns boolean

      true while render work is in progress; otherwise false.

    • Indicates whether the current engine state can be serialized safely.

      This also waits for pending background media hashes (see Settings::setMediaBackgroundHashing): a media serialized without its hash could not be restored from storage on the next load.

      Returns boolean

      true when the engine is ready and the library is not processing background work; otherwise false.

    • Pauses timeline playback without discarding the current playhead position.

      Returns Promise<void>

      A promise that resolves after playback has paused.

    • Starts timeline playback.

      Returns Promise<void>

      A promise that resolves after playback has started.

    • Registers a custom clip constructor under a clip type identifier.

      Type Parameters

      Parameters

      • classType: CustomClipConstructor<T>

        Constructor used to create clip instances of the custom type.

      • typeEnum: string

        Clip type identifier associated with the constructor.

      Returns void

      Nothing.

    • Replaces the current project with a fresh empty project.

      Returns Promise<void>

      A promise that resolves after the reset project has been deserialized.

    • Moves the timeline playhead to the requested time.

      Parameters

      • value: number

        Target timeline time, in seconds.

      Returns Promise<void>

      A promise that resolves after seeking has completed.

    • Serializes the current project into a schema-validated plain object.

      Returns {
          createdAt?: number;
          customData?: [string, unknown][];
          display: { backgroundColor: string; height: number; width: number };
          fontRegistry?: {
              fonts: {
                  customData?: [string, unknown][];
                  descriptors?: { style?: string; weight?: string };
                  family: string;
                  src: string;
              }[];
          };
          library: {
              customData?: [string, unknown][];
              effects: {
                  autoFit?: boolean;
                  blendMode?: NORMAL | ADD | SCREEN | MULTIPLY;
                  fragmentSrc: string;
                  id: string;
                  inputTextures?: {
                      mipmap?: OFF | ON;
                      name: string;
                      scaleMode?: NEAREST | LINEAR;
                      url: string;
                      wrapMode?: CLAMP | REPEAT | MIRRORED_REPEAT;
                  }[];
                  name: string;
                  noTransform?: boolean;
                  padding?: number;
                  properties: {
                      defaultValue: Required<any>;
                      description?: string;
                      initOnly?: boolean;
                      label?: string;
                      max?: number | number[];
                      min?: number | number[];
                      name: string;
                      step?: number | number[];
                      type: PropertyDescriptionTypeEnum;
                  }[];
                  provider: string;
              }[];
              filters: { id: string; lutUrl: string; name: string; provider: string }[];
              media: {
                  customData?: [string, unknown][];
                  duration?: number;
                  filename: string;
                  fitStrategy?: {
                      fitStyle?: ORIGINAL | MATCH_SCALE | OUTSIDE | INSIDE | MATCH_SIZE;
                      toCrop?: boolean;
                  };
                  hash?: string;
                  height?: number;
                  id: string;
                  mimeType?: string;
                  name?: string;
                  permanentUrl?: string;
                  placeholderClipIds?: string[];
                  type: string;
                  width?: number;
              }[];
              subtitles: {
                  duration: number;
                  id: string;
                  language: string;
                  textBlocks: {
                      duration: number;
                      text: string;
                      time: number;
                      wordTimings?: number[];
                  }[];
              }[];
              transitions: {
                  id: string;
                  inputTextures?: {
                      mipmap?: OFF
                      | ON;
                      name: string;
                      scaleMode?: NEAREST | LINEAR;
                      url: string;
                      wrapMode?: CLAMP | REPEAT | MIRRORED_REPEAT;
                  }[];
                  name: string;
                  properties: {
                      defaultValue: Required<any>;
                      description?: string;
                      initOnly?: boolean;
                      label?: string;
                      max?: number | number[];
                      min?: number | number[];
                      name: string;
                      step?: number | number[];
                      type: PropertyDescriptionTypeEnum;
                  }[];
                  provider: string;
                  transitionSrc: string;
              }[];
          };
          projectId?: string;
          settings?: {
              clipAudioMonoChannelsWeight: number[];
              clipAudioMonoMixType: MonoMixType;
              clipAudioSampleForceMono: boolean;
              clipAudioSampleRate: number;
              clipAudioSeekThreshold: number;
              clipAudioStoreSamples: boolean;
              clipImageLoadOnInit: boolean;
              clipVideoDynamicLoad: boolean;
              clipVideoDynamicLoadTime: number;
              clipVideoFilmstripInterval: number;
              clipVideoFilmstripKeyframesOnly: boolean;
              clipVideoFilmstripMaxFrames: number;
              clipVideoFilmstripMaxHeight: number;
              clipVideoFilmstripMaxWidth: number;
              clipVideoFilmstripMaxWorkers: number;
              clipVideoSeekThreshold: number;
              clipVideoStoreFilmstrip: boolean;
              clipVideoStoreSamples: boolean;
              decoderPreferredAcceleration: PreferredAcceleration;
              decoderUseSeparateWorker: boolean;
              decoderUseSubImage: boolean;
              decoderUseWebCodecs: boolean;
              encoderBitrate: number;
              encoderBitrateMode: BitrateMode;
              encoderCodec: VideoCodec;
              encoderCrf: number;
              encoderDeadline: number;
              encoderForcedCodecRFCString: string;
              encoderKeyframeInterval: number;
              encoderPerformanceMode: PerformanceMode;
              encoderPreferredAcceleration: PreferredAcceleration;
              encoderUseAlpha: boolean;
              encoderUseWebCodecs: boolean;
              m3u8MaxResolution: [number, number];
              mediaBackgroundHashing: boolean;
              mediaHashAlgorithm: HashAlgorithmEnum;
              mediaHashMaxWorkers: number;
              mediaInfoMaxWorkers: number;
              mediaTranscodeMaxWorkers: number;
              renderAudioUseWorker: boolean;
              renderCancelFailTimeout: number;
              renderChunkedOutputMaxSize: number;
              renderFixAntialiasDiagonal: boolean;
              renderMaxQueueSize: number;
              renderProcessingStallTimeout: number;
              renderShowPreview: boolean;
              renderThrottleFactor: number;
              renderUseChunkedOutput: boolean;
              renderVideoUseDirectFrames: boolean;
              subtitlesAutoWrapOnResize: boolean;
              subtitlesScaleOnResize: boolean;
              useInternalTranscoder: boolean;
              viewAutoLayoutOnResize: AutoLayoutMode;
          };
          subtitlesManager?: {
              highlightAnimation: HighlightAnimationEnum;
              highlightAnimationSpeed: number;
              highlightEnabled: boolean;
              highlightTextStyle: {
                  backgroundColor: string;
                  backgroundCornerRadius: number;
                  backgroundPadding: number;
                  color: string;
                  dropShadow: boolean;
                  dropShadowAlpha: number;
                  dropShadowAngle: number;
                  dropShadowBlur: number;
                  dropShadowColor: string;
                  dropShadowDistance: number;
                  fontFamily: string;
                  fontSize: number;
                  fontStyle: "normal"
                  | "italic"
                  | "oblique";
                  fontWeight:
                      | "normal"
                      | "bold"
                      | "bolder"
                      | "lighter"
                      | "100"
                      | "200"
                      | "300"
                      | "400"
                      | "500"
                      | "600"
                      | "700"
                      | "800"
                      | "900";
                  letterSpacing: number;
                  padding: number;
                  strokeColor: string;
                  strokeThickness: number;
              };
              mainTextStyle: {
                  backgroundColor: string;
                  backgroundCornerRadius: number;
                  backgroundPadding: number;
                  color: string;
                  dropShadow: boolean;
                  dropShadowAlpha: number;
                  dropShadowAngle: number;
                  dropShadowBlur: number;
                  dropShadowColor: string;
                  dropShadowDistance: number;
                  fontFamily: string;
                  fontSize: number;
                  fontStyle: "normal"
                  | "italic"
                  | "oblique";
                  fontWeight:
                      | "normal"
                      | "bold"
                      | "bolder"
                      | "lighter"
                      | "100"
                      | "200"
                      | "300"
                      | "400"
                      | "500"
                      | "600"
                      | "700"
                      | "800"
                      | "900";
                  leading: number;
                  letterSpacing: number;
                  lineHeight: number;
                  padding: number;
                  strokeColor: string;
                  strokeThickness: number;
                  wordWrap: boolean;
                  wordWrapWidth: number;
              };
              position?: [number, number];
              scale: number;
              textMode: "partial" | "full";
          };
          timeline: {
              customData?: [string, unknown][];
              fitDuration: number;
              fps: number;
              layers: {
                  clips: any[];
                  customData?: [string, unknown][];
                  id: string;
                  muted?: boolean;
                  name?: string;
                  transitions: {
                      endClipId: string;
                      id: string;
                      inDuration: number;
                      outDuration: number;
                      properties: [string, any][];
                      provider: string;
                      startClipId: string;
                      transitionId: string;
                  }[];
                  visible?: boolean;
                  volume?: number;
              }[];
              startTime: number;
              volume: number;
          };
          version?: string;
      }

      The serialized engine payload.

    • Replaces all custom metadata entries with the supplied map.

      Parameters

      • data: Map<string, unknown>

        Metadata map to store.

      Returns void

      Nothing.

    • Stores custom metadata on the engine instance.

      Parameters

      • key: string

        Metadata key to write.

      • value: unknown

        Metadata value to store.

      • overwrite: boolean = true

        When false, existing values are preserved and the write is rejected.

      Returns boolean

      true if the value was stored; otherwise false.

    • Replaces the active project identifier and reinitializes storage for the new project.

      Parameters

      • id: string

        Project identifier to assign.

      Returns Promise<void>

      A promise that resolves after storage has been rebound to the new project ID.

    • Activates a subtitles track on the timeline.

      Parameters

      • subtitlesId: string

        Subtitle track identifier to apply.

      • offset: number

        Time offset, in seconds, used when synchronizing the subtitles track.

      Returns void

      Nothing.

    • Indicates whether imported media should have audio separated for the current platform.

      Returns boolean

      true when audio splitting should be enabled; otherwise false.

    • Stops timeline playback.

      Returns Promise<void>

      A promise that resolves after playback has stopped.

    • Restores engine state from a serialized project payload.

      If another deserialization is already in progress, the latest payload is queued and processed after the active deserialization finishes.

      Parameters

      • data: object

        Serialized engine payload to load.

      Returns Promise<undefined | void | Engine>

      A promise that resolves to the engine instance once deserialization finishes.

    • Returns the SDK version bundled into the current build.

      Returns string

      The current SDK version string.