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

    Class Subtitles

    Library subtitles asset composed of ordered timed text blocks.

    Besides storing subtitle content, this class keeps linked timeline subtitle clips in sync when blocks are edited, inserted, removed, or when duration changes as a result of content edits.

    Index

    Constructors

    • Parameters

      • Optionaloptions: SubtitlesOptions

      Returns Subtitles

    Methods

    • Inserts a subtitle block and updates dependent subtitle clips.

      Parameters

      • textBlock: TextBlock

        Subtitle block to insert.

      • Optionalindex: number

        Optional insertion index. Defaults to appending at the end.

      Returns void

    • Creates a deep clone by round-tripping through serialized data.

      Returns Subtitles

      Cloned subtitles asset.

    • Recomputes the subtitles duration from the current block list.

      Returns void

    • Returns number

    • Returns string

    • Returns string

    • Removes a subtitle block by index and updates dependent subtitle clips.

      Parameters

      • index: number

        Index of the block to remove.

      Returns void

    • Serializes the subtitles asset into project-safe data.

      Returns {
          duration: number;
          id: string;
          language: string;
          textBlocks: {
              duration: number;
              text: string;
              time: number;
              wordTimings?: number[];
          }[];
      }

      Serialized subtitles payload.

    • Parameters

      • language: string

      Returns void

      • Language is not used and probably not be used
    • Replaces the entire subtitle block list.

      Parameters

      • textBlocks: TextBlock[]

        New ordered subtitle blocks.

      Returns void

    • Pushes subtitle duration changes to every timeline clip linked to this subtitles asset.

      Returns void

    • Partially updates one subtitle block in place.

      Parameters

      • index: number

        Index of the block to update.

      • textBlock: Partial<TextBlock>

        Partial block fields to merge into the existing block.

      Returns void

    • Performs lightweight integrity checks on block ordering, timing, and overlap.

      Returns void

    • Reconstructs a subtitles asset from serialized data.

      Parameters

      • data: object

        Serialized subtitles payload.

      Returns Subtitles

      Deserialized subtitles asset.