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

    Class Library

    Owns project media, subtitles, effects, filters, transitions, and related asset-processing workflows.

    Index

    Constructors

    • Creates an empty project library.

      Returns Library

    Properties

    builtInEffects: Record<string, EffectData> = {}
    effects: Record<string, EffectData>
    filters: Record<string, FilterData>
    media: Record<string, MediaData>
    subtitles: Record<string, Subtitles>
    transitions: Record<string, TransitionData>

    Methods

    • Registers a custom effect definition in the library.

      Parameters

      Returns Promise<string>

      A promise that resolves to the created effect ID.

    • Registers a filter definition in the library.

      Parameters

      Returns Promise<string>

      A promise that resolves to the created filter ID.

    • Imports media into the library from a file, URL, or raw bytes.

      Parameters

      • source: string | Uint8Array<ArrayBufferLike> | File

        Media source to import.

      • OptionalmimeType: string

        Optional MIME type override for byte or URL inputs.

      • Optionalfilename: string

        Optional filename override.

      Returns Promise<null | string>

      A promise that resolves to the created media ID, or null if creation fails before an ID is available.

    • Restores a serialized media asset into the library.

      Parameters

      • data: any

        Serialized media payload.

      Returns Promise<string>

      A promise that resolves to the restored media ID.

    • Adds a subtitles asset to the library.

      Parameters

      Returns string

      The subtitles asset ID.

    • Registers a transition definition in the library.

      Parameters

      Returns Promise<string>

      A promise that resolves to the created transition ID.

    • Removes all custom metadata stored on the library.

      Returns void

      Nothing.

    • Creates and initializes the built-in effect definitions exposed by the SDK.

      Returns Promise<void>

      A promise that resolves after all built-in effects have been registered.

    • Queues filmstrip extraction for a media asset.

      Parameters

      • mediaId: string

        Media asset ID to process.

      Returns Promise<void>

      A promise that resolves after the request has been queued.

    • Deletes a media asset and removes any clips that depend on it.

      Parameters

      • id: string

        Media asset ID to delete.

      Returns Promise<void>

      A promise that resolves after deletion completes.

    • Destroys active background workers and releases all media assets.

      Returns Promise<void>

      A promise that resolves after teardown completes.

    • Extracts an audio track from a video media asset and imports it back into the library.

      Parameters

      • mediaId: string

        Video media asset ID.

      • audioTrackIndex: number = 0

        Audio stream index to extract.

      Returns Promise<null | string>

      A promise that resolves to the new audio media ID, or null if extraction fails.

    • Returns a copy of all custom metadata stored on the library.

      Returns undefined | Map<string, unknown>

      A copied metadata map, or undefined if no custom data has been stored.

    • Returns all available effect IDs, including registered custom effects and built-in effects.

      Returns string[]

      The combined effect ID list.

    • Returns the IDs of built-in effects shipped with the SDK.

      Returns string[]

      The built-in effect IDs.

    • Returns a previously stored library metadata value.

      Parameters

      • key: string

        Metadata key to look up.

      Returns unknown

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

    • Returns an effect definition by ID, including built-in effects.

      Parameters

      • id: string

        Effect definition ID.

      Returns undefined | EffectData

      The matching effect definition, or undefined if not found.

    • Returns a filter definition by ID.

      Parameters

      • id: string

        Filter definition ID.

      Returns undefined | FilterData

      The matching filter definition, or undefined if not found.

    • Returns the IDs of all registered filters.

      Returns string[]

      The registered filter IDs.

    • Returns a media asset by its library ID.

      Parameters

      • id: string

        Media asset ID to look up.

      Returns undefined | MediaData

      The matching media asset, or undefined if not found.

    • Returns the IDs of custom effects registered in this library instance.

      Returns string[]

      The registered custom effect IDs.

    • Returns a subtitles asset by ID.

      Parameters

      • id: string

        Subtitles asset ID.

      Returns undefined | Subtitles

      The matching subtitles asset, or undefined if not found.

    • Returns the IDs of all subtitles assets in the library.

      Returns string[]

      The subtitles asset IDs.

    • Returns a transition definition by ID.

      Parameters

      • id: string

        Transition definition ID.

      Returns undefined | TransitionData

      The matching transition definition, or undefined if not found.

    • Returns the IDs of all registered transitions.

      Returns string[]

      The registered transition IDs.

    • Indicates whether the library has a stored metadata value for the provided key.

      Parameters

      • key: string

        Metadata key to test.

      Returns boolean

      true if the key exists; otherwise false.

    • Initializes all library assets and built-in effect definitions.

      Returns Promise<void>

      A promise that resolves after the library is ready for use.

    • Indicates whether any media asset is still loading, transcoding, or processing.

      Returns boolean

      true if any media item is still processing; otherwise false.

    • Reads media metadata without adding the media to the library.

      Parameters

      • file: string | Uint8Array<ArrayBufferLike> | File

        Media source to probe.

      Returns Promise<null | MediaInfo>

      A promise that resolves to media metadata, or null if probing fails.

    • Removes a custom effect definition from the library.

      Parameters

      • id: string

        Effect definition ID to remove.

      Returns void

      Nothing.

    • Removes a filter definition from the library.

      Parameters

      • id: string

        Filter definition ID to remove.

      Returns void

      Nothing.

    • Removes a subtitles asset from the library and deletes dependent timeline clips.

      Parameters

      • id: string

        Subtitles asset ID to remove.

      Returns void

      Nothing.

    • Removes a transition definition from the library.

      Parameters

      • id: string

        Transition definition ID to remove.

      Returns void

      Nothing.

    • Removes unused media, subtitles, effects, filters, and transitions from the library.

      Returns Promise<void>

      A promise that resolves after all removable assets have been processed.

    • Removes custom effects that are not referenced by any clip on the timeline.

      Returns void

      Nothing.

    • Removes filters that are not referenced by any clip on the timeline.

      Returns void

      Nothing.

    • Removes media assets that are not referenced by any clip on the timeline.

      Returns Promise<void>

      A promise that resolves after all unused media items have been deleted.

    • Removes subtitles assets that are not referenced by any clip on the timeline.

      Returns void

      Nothing.

    • Removes transitions that are not referenced by any layer on the timeline.

      Returns void

      Nothing.

    • Replaces an existing media asset with new source content while preserving the media ID.

      Parameters

      • id: string

        Media asset ID to replace.

      • file: string | Uint8Array<ArrayBufferLike> | File

        Replacement media source.

      • OptionalreplaceOptions: ReplaceMediaOptions

        Optional replacement behavior.

      Returns Promise<boolean>

      A promise that resolves to true if replacement succeeds.

    • Replaces an existing media asset with serialized media data.

      Parameters

      • data: any

        Serialized replacement media payload.

      Returns Promise<boolean>

      A promise that resolves to true if replacement succeeds.

    • Serializes the library and all serializable assets it owns.

      Returns {
          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][];
              filename: string;
              hash?: string;
              id: string;
              mimeType?: string;
              name?: string;
              permanentUrl?: string;
              placeholderClipIds?: string[];
              type: string;
          }[];
          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;
          }[];
      }

      The serialized library payload.

    • Replaces all custom library metadata with a copy of the provided map.

      Parameters

      • data: Map<string, unknown>

        Metadata entries to store.

      Returns void

      Nothing.

    • Stores an arbitrary metadata entry on the library instance.

      Parameters

      • key: string

        Metadata key.

      • value: unknown

        Metadata value.

      • overwrite: boolean = true

        Whether an existing value for the same key may be replaced.

      Returns boolean

      true if the value was stored; otherwise false when overwrite is disabled and the key already exists.

    • Persists every library media item through the configured storage controller.

      Returns Promise<void>

      A promise that resolves after all store requests have settled.

    • Synchronizes stored media across all configured storage providers.

      Returns Promise<void>

      A promise that resolves after synchronization completes.

    • Creates a library instance from serialized data.

      Parameters

      • data: object

        Serialized library payload.

      Returns Library

      The deserialized library.