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

    Class MediaData

    Library record representing one imported media asset and all of its derived runtime metadata.

    A MediaData instance tracks the original payload, FFmpeg-mountable source, derived previews, placeholder-clip resolution, storage sync, and hash/metadata information needed across the editor.

    Index

    Constructors

    • Parameters

      • Optionalid: string
      • OptionalforcedHash: string

      Returns MediaData

    Properties

    audioSplit?: string
    blobUrl?: string
    customData?: Map<string, unknown>
    duration?: number
    filename: string
    filmstrip?: string

    This is an url for a filmstrip placeholder

    fitStrategy?: MediaFitStrategy

    Fit strategy used to refit clips when the loaded media differs from the serialized one.

    hash?: string
    height?: number
    mediaSource?: File | Blob

    Media payload used by previews, playback, object URLs, and FFmpeg mounts. Preserves File instances when available.

    metadata?: MediaInfo
    mimeType?: string
    permanentUrl?: string
    placeholderClipIds: string[] = []
    size: number = 0
    storePath?: string
    thumbnail?: string
    type: string
    width?: number

    Methods

    • Parameters

      • clipId: string

      Returns Promise<void>

    • Returns Promise<boolean>

    • Returns void

    • Returns Promise<void>

    • Returns undefined | Map<string, unknown>

    • Parameters

      • startTime: number
      • Optionalduration: number

      Returns null | Float32Array<ArrayBufferLike>[]

    • Parameters

      • key: string

      Returns unknown

    • Returns the fit strategy used when a different media loads behind this media id.

      Returns undefined | MediaFitStrategy

      The configured fit strategy, or undefined when the defaults apply.

    • Returns undefined | string

    • Returns the media hash computation state.

      NONE before any hashing, PARTIAL while a hash is being computed (inline or in the background), DONE once getHash() is available, ERROR when hashing failed.

      Returns MediaProcessStatusEnum

      The hash processing state.

    • Returns the stable library media id.

      Returns string

      Media id.

    • Returns the media payload, preserving File identity when available.

      Returns undefined | File | Blob

    • Returns the current display name of the media asset.

      Returns string

      Media name.

    • Returns the ids of placeholder clips currently waiting for this media to finish loading.

      Returns readonly string[]

      Read-only placeholder clip id list.

    • Serialized-project media duration in seconds; see getSerializedWidth.

      Returns undefined | number

    • Serialized-project media height; see getSerializedWidth.

      Returns undefined | number

    • Returns the media width as it was in the serialized project (captured before load() overwrote it), or undefined for media created in this session or old projects that did not serialize dimensions.

      Returns undefined | number

    • Builds the normalized storage payload used by storage providers.

      The method only succeeds once the media is fully ready and has a content hash plus a source payload.

      Returns Promise<null | StorageMediaData>

      Storage payload, or null when the media is not ready for persistence.

    • Parameters

      • key: string

      Returns boolean

    • Returns boolean

    • Indicates whether a content hash may still materialize for this media (still loading, or a background hash is in flight). Used to defer storage removals during sync.

      Returns boolean

      true while the hash is still pending.

    • Parameters

      • file: string | Uint8Array<ArrayBufferLike> | File
      • mimeType: undefined | string

      Returns Promise<
          | {
              data?: undefined;
              filePath?: undefined;
              mimeType?: undefined;
              status: boolean;
          }
          | {
              data: Uint8Array<ArrayBufferLike>;
              filePath: string;
              mimeType: string;
              status: boolean;
          },
      >

    • Parameters

      • file: string | Uint8Array<ArrayBufferLike> | File
      • mimeType: undefined | string

      Returns Promise<
          | {
              data?: undefined;
              filePath?: undefined;
              mimeType?: undefined;
              status: boolean;
          }
          | {
              data: Uint8Array<ArrayBufferLike>;
              filePath: string;
              mimeType: string;
              status: boolean;
          },
      >

    • Parameters

      • file: string | Uint8Array<ArrayBufferLike> | File
      • mimeType: undefined | string

      Returns Promise<
          | {
              data?: undefined;
              filePath?: undefined;
              mimeType?: undefined;
              status: boolean;
          }
          | {
              data: Uint8Array<ArrayBufferLike>;
              filePath: string;
              mimeType: string;
              status: boolean;
          },
      >

    • Initializes a deserialized media, restoring it from storage or reloading its permanent URL.

      Like load, it guarantees the status settles to ERROR on failure so it never stays on a transient value — see Library::hasLoadingMedia.

      Returns Promise<void>

      A promise that resolves once the media has been initialized.

    • Loads media from a file, URL or raw bytes.

      Guarantees the status always settles: on any failure it lands on ERROR (or stays DESTROYED when the media was destroyed mid-load) instead of being left on a transient LOADING/ FILMSTRIP value. Callers rely on a settled status — see Library::hasLoadingMedia.

      Parameters

      • file: string | Uint8Array<ArrayBufferLike> | File

        Media source.

      • OptionalmimeType: string

        Optional mime type override.

      • Optionalfilename: string

        Optional filename override.

      Returns Promise<void>

      A promise that resolves once the media has loaded.

    • Returns void

    • Returns void

    • Parameters

      • key: string

      Returns boolean

    • Parameters

      • clipId: string

      Returns void

    • Returns Promise<boolean>

    • Serializes the media record into project-safe data.

      Returns {
          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;
      }

      Serialized media record payload.

    • Parameters

      • data: Map<string, unknown>

      Returns void

    • Parameters

      • key: string
      • value: unknown
      • overwrite: boolean = true

      Returns boolean

    • Sets the fit strategy applied to dependent clips when the loaded media turns out to be different from the media the project was serialized with (see Library.applyMediaFitStrategies).

      Parameters

      • fitStrategy: undefined | MediaFitStrategy

        Fit strategy, or undefined for the defaults (MATCH_SCALE, crop remapped).

      Returns void

      Nothing.

    • Parameters

      • name: string

      Returns void

    • Parameters

      • url: null | string

      Returns void

    • Returns Promise<void>

    • Parameters

      Returns Promise<boolean>

    • Reconstructs a media record shell from serialized project data.

      Runtime-only fields such as thumbnails, FFmpeg paths, and loaded blob URLs are intentionally not restored here.

      Parameters

      • data: object

        Serialized media payload.

      Returns MediaData

      Deserialized media record.

    • Returns void