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

    Class Layer

    Represents a timeline layer that owns clips, transitions, and layer-level playback state.

    Index

    Constructors

    • Creates an empty layer and records its creation in the undo stack.

      Returns Layer

    Properties

    clips: Record<string, Clip>
    clipsIds: string[]
    container: Container
    id: string
    muted: boolean
    name: string
    transitions: Transition[]
    visible: boolean
    volume: number

    Methods

    • Resolves negative positions and overlapping clips by moving clips to the next valid slot.

      Returns boolean

      true if any clip positions changed; otherwise false.

    • Removes all custom metadata entries from the layer.

      Returns void

      Nothing.

    • Destroys the layer container and all owned clips and transitions.

      Returns void

      Nothing.

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

      Returns undefined | Map<string, unknown>

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

    • Returns the clip IDs in layer order.

      Returns string[]

      The ordered clip ID list.

    • Returns a custom metadata value stored on the layer.

      Parameters

      • key: string

        Metadata key to read.

      Returns unknown

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

    • Returns the right-most occupied time on the layer.

      Returns number

      The layer duration in timeline seconds.

    • Returns the display name of the layer.

      Returns string

      The layer name.

    • Returns the earliest available start time at or after the requested range that avoids overlaps.

      Parameters

      • startTime: number

        Desired start time in seconds.

      • endTime: number

        Desired end time in seconds.

      Returns number

      The next available start time in seconds.

    • Returns a transition by its instance ID.

      Parameters

      • id: string

        Transition instance ID to look up.

      Returns null | Transition

      The matching transition, or null if not found.

    • Returns all transitions on this layer.

      Returns Transition[]

      The transition list.

    • Returns whether the layer is currently visible.

      Returns boolean

      true if the layer is visible; otherwise false.

    • Returns the layer volume multiplier.

      Returns number

      The layer volume.

    • Checks whether a custom metadata entry exists on the layer.

      Parameters

      • key: string

        Metadata key to check.

      Returns boolean

      true if the key exists; otherwise false.

    • Checks whether the supplied time range is free of clip overlap on this layer.

      Parameters

      • startTime: number

        Range start time in seconds.

      • endTime: number

        Range end time in seconds.

      Returns boolean

      true if the range is empty on this layer; otherwise false.

    • Initializes the PIXI container for this layer and initializes all contained transitions and clips.

      Returns Promise<void>

      A promise that resolves after the layer is ready for rendering.

    • Indicates whether the layer contains any clips.

      Returns boolean

      true if the layer has no clips; otherwise false.

    • Indicates whether the layer is muted.

      Returns boolean

      true if the layer is muted; otherwise false.

    • Moves a clip from this layer to another layer.

      Parameters

      • clipId: string

        Clip ID to move.

      • newLayerId: string

        Destination layer ID.

      Returns void

      Nothing.

    • Lifecycle hook called when playback pauses.

      Parameters

      • currentTime: number

        Current timeline time, in seconds.

      Returns void

      Nothing.

    • Lifecycle hook called when playback starts.

      Parameters

      • currentTime: number

        Current timeline time, in seconds.

      Returns Promise<void>

      A promise that resolves after all owned clips and transitions have handled playback start.

    • Lifecycle hook called when the render size changes.

      Parameters

      • width: number

        New render width in pixels.

      • height: number

        New render height in pixels.

      Returns void

      Nothing.

    • Performs post-render work for all clips and transitions on this layer.

      Parameters

      • currentTime: number

        Current timeline time, in seconds.

      Returns void

      Nothing.

    • Removes all transitions that were created from the specified transition definition ID.

      Parameters

      • transitionId: string

        Transition definition ID to remove.

      Returns void

      Nothing.

    • Removes a clip and any transitions that depend on it.

      Parameters

      • clipId: string

        Clip ID to remove.

      Returns boolean

      true if the clip was found and removed; otherwise false.

    • Parameters

      • id: string

      Returns void

    • Renders all clips and transitions owned by this layer for the current frame.

      Parameters

      • currentTime: number

        Current timeline time, in seconds.

      Returns Container<DisplayObject>

      The PIXI container used to display the layer.

    • Serializes the layer, including clips, transitions, and custom data.

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

      The serialized layer payload.

    • Replaces all custom metadata entries on the layer.

      Parameters

      • data: Map<string, unknown>

        Metadata map to store.

      Returns void

      Nothing.

    • Stores custom metadata on the layer.

      Parameters

      • key: string

        Metadata key to write.

      • value: unknown

        Metadata value to store.

      • overwrite: boolean = true

        When false, preserves existing values and rejects duplicate keys.

      Returns boolean

      true if the value was stored; otherwise false.

    • Mutes or unmutes the layer.

      Parameters

      • muted: boolean

        Whether the layer should be muted.

      Returns void

      Nothing.

    • Sets the display name of the layer.

      Parameters

      • name: string

        Layer name to assign.

      Returns void

      Nothing.

    • Shows or hides the entire layer container.

      Parameters

      • visible: boolean

        Whether the layer should be visible.

      Returns void

      Nothing.

    • Sets the layer volume multiplier.

      Parameters

      • volume: number

        Layer volume multiplier.

      Returns void

      Nothing.

    • Sets the renderer z-index for this layer container.

      Parameters

      • zIndex: number

        Layer z-index.

      Returns void

      Nothing.

    • Splits a clip into two clips at the supplied timeline time.

      Parameters

      • clipId: string

        Clip ID to split.

      • time: number

        Timeline time, in seconds, where the split should happen.

      Returns Promise<null | Clip<Sprite, ClipStyle<Sprite>>>

      A promise that resolves to the newly created right-side clip, or null if the split is invalid.

    • Updates all clips and transitions owned by this layer for the current time.

      Parameters

      • currentTime: number

        Current timeline time, in seconds.

      Returns void

      Nothing.

    • Creates a layer from serialized data.

      Parameters

      • data: object

        Serialized layer payload.

      Returns Layer

      The deserialized layer.