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

    Class VideoClip

    Clip implementation that renders video media, handles preview playback, and supports audio extraction and frame access.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    Methods

    addClipMask addEffect addFilter applyVolume clearAllCustomData clone destroy discardProcessing extractAudioClip extractFrameAsBase64Image extractMonoAudioData generateNewId getAllCustomData getAnimationPropertyValue getAudioSamples getBlendMode getCustomData getDuration getEffectById getEffects getEndTime getFilmstripData getFilmstripDataRange getFilmstripState getFilterById getFilters getFreezeTime getId getInsideTransition getIsProcessing getLayerId getLeftBound getLeftRenderBound getLeftTrim getMasks getMediaId getName getPerservePitch getPlaybackSpeed getRightBound getRightRenderBound getRightTrim getStartTime getSubtitlesId getSubtitlesOffset getTransitionInId getTransitionOutId getTrimmedDuration getType getVisible getVolume getVolumeFadeInCurve getVolumeFadeInDuration getVolumeFadeOutCurve getVolumeFadeOutDuration getWrapMode hasCustomData hasName hasSprite hitTest init isActive isMuted isReady moveBy onPause onPlay onRenderDone onRenderStart onResize postRender preload registerEffectProperties registerFilterProperties removeAllEffectsByEffectId removeClipMask removeEffect removeFilter removeFreezeTime removeSubtitles render resetAllAnimationProperties resetAnimationPropertyValue serialize setAllCustomData setAnimationPropertyValue setBlendMode setCustomData setFreezeTime setInsideInTransition setInsideOutTransition setLayerId setLeftTrim setMuted setName setPerservePitch setPlaybackSpeed setRightTrim setStartTime setSubtitles setSubtitlesId setSubtitlesOffset setTransitionInId setTransitionOutId setVisible setVolume setVolumeFadeInCurve setVolumeFadeInDuration setVolumeFadeOutCurve setVolumeFadeOutDuration setWrapMode unregisterEffectProperties unregisterFilterProperties update updateMediaData updateVisibility deserialize

    Constructors

    Properties

    animationController: AnimationClass
    id: string
    propertyAnimator: PropertyAnimator
    sprite: Sprite
    state: ClipState
    style: ClipStyle

    Methods

    • Uses another clip as a mask source for this clip.

      Parameters

      • clip: Clip

        Clip whose sprite should be used as the mask source.

      • Optionaloptions: MaskOptions

        Optional mask behavior.

      Returns undefined | MaskFilter

      The created mask filter, or undefined if the source clip has no sprite.

    • Applies clip, layer, timeline, and fade multipliers to the underlying video and split-audio element volume.

      Returns void

      Nothing.

    • Removes all custom metadata stored on the clip.

      Returns void

      Nothing.

    • Creates a cloned video clip instance from serialized data.

      Returns VideoClip

      A cloned video clip.

    • Releases video/audio elements, decoder resources, texture state, and clip runtime data.

      Returns void

      Nothing.

    • Clears any queued media actions waiting to run on the video or split-audio elements.

      Returns void

      Nothing.

    • Creates a timeline audio clip from the video's audio track.

      Parameters

      • muteAudio: boolean = true

        Whether the original video clip should be muted after extraction.

      • createNewMediaData: boolean = true

        Whether a new audio-only media asset should be created in the library.

      • audioTrackIndex: number = 0

        Audio stream index to extract.

      Returns Promise<null | AudioClip>

      A promise that resolves to the created audio clip, or null if extraction fails.

    • Captures the current rendered video frame as a base64-encoded image.

      Parameters

      • options: { mimeType: string; quality: number } = ...

        Output image encoding options.

      Returns Promise<null | string>

      A promise that resolves to the encoded image, or null if frame extraction is unavailable.

    • Parameters

      • startTime: number
      • endTime: number

      Returns Promise<null | Float32Array<ArrayBufferLike>>

      Use getAudioSamples instead, don't forget to enable them in the settings

    • Generates a new clip ID and updates dependent runtime objects that store that ID.

      Returns void

      Nothing.

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

      Returns undefined | Map<string, unknown>

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

    • Parameters

      • property: string

      Returns string | number

    • Returns decoded audio samples from the video's underlying media asset.

      Parameters

      • startTime: number

        Start time in seconds, relative to the source media.

      • Optionalduration: number

        Optional duration in seconds to extract.

      Returns null | Float32Array<ArrayBufferLike>[]

      The audio sample channels, or null if the media data is unavailable.

    • Returns a stored metadata value for the clip.

      Parameters

      • key: string

        Metadata key to look up.

      Returns unknown

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

    • Returns the full clip duration before trims are applied.

      Returns number

      The clip duration in seconds.

    • Returns the effects currently attached to the clip.

      Returns Effect[]

      The clip effects.

    • Returns the clip end time in timeline space.

      Returns number

      The clip end time in seconds.

    • Returns all available filmstrip frames for the backing media asset.

      Returns IFilmstripData[]

      The filmstrip frame metadata.

    • Returns filmstrip frames that fall within the provided time range.

      Parameters

      • start: number

        Range start time in seconds.

      • end: number

        Range end time in seconds.

      Returns IFilmstripData[]

      The matching filmstrip frame metadata.

    • Returns the filters currently attached to the clip.

      Returns Filter[]

      The clip filters.

    • Returns the frozen local media time, if one is set.

      Returns undefined | number

      The frozen media time in seconds, or undefined if freeze is disabled.

    • Returns the clip ID.

      Returns string

      The clip ID.

    • Indicates whether the clip is currently part of any transition.

      Returns boolean

      true if the clip is inside an incoming or outgoing transition; otherwise false.

    • Indicates whether the clip is currently processing a queued seek, play, pause, or render-preparation action.

      Returns boolean

      true if asynchronous clip work is still in progress; otherwise false.

    • Returns the ID of the layer that currently owns the clip.

      Returns string

      The owning layer ID.

    • Returns the first visible playback time of the clip after left trim is applied.

      Returns number

      The left playback bound in seconds.

    • Returns the earliest timeline time where the clip may need to render, including incoming transition coverage.

      Returns number

      The left render bound in seconds.

    • Returns the amount trimmed from the left edge of the clip.

      Returns number

      Left trim in seconds.

    • Returns the media asset ID currently bound to the clip.

      Returns undefined | string

      The media asset ID, or undefined for clips without media.

    • Returns the user-visible clip name.

      Returns string

      The clip name.

    • Indicates whether pitch preservation is enabled during speed changes.

      Returns boolean

      true if pitch preservation is enabled; otherwise false.

    • Returns the playback speed multiplier.

      Returns number

      The playback speed multiplier.

    • Returns the final visible playback time of the clip after right trim is applied.

      Returns number

      The right playback bound in seconds.

    • Returns the latest timeline time where the clip may need to render, including outgoing transition coverage.

      Returns number

      The right render bound in seconds.

    • Returns the amount trimmed from the right edge of the clip.

      Returns number

      Right trim in seconds.

    • Returns the clip start time in timeline space.

      Returns number

      The clip start time in seconds.

    • Returns the subtitles asset ID currently assigned to the clip.

      Returns undefined | string

      The subtitles asset ID, or undefined if none is assigned.

    • Returns the stored subtitles offset for the clip.

      Returns number

      The subtitles offset in seconds.

    • Returns the incoming transition ID associated with the clip.

      Returns null | string

      The incoming transition ID, or null if none is set.

    • Returns the outgoing transition ID associated with the clip.

      Returns null | string

      The outgoing transition ID, or null if none is set.

    • Returns the playable duration after both trims are applied.

      Returns number

      The trimmed duration in seconds.

    • Returns the clip type identifier.

      Returns string

      The clip type.

    • Indicates whether the clip is marked as visible.

      Returns boolean

      true if the clip is renderable; otherwise false.

    • Returns the clip volume multiplier.

      Returns number

      The clip volume multiplier.

    • Returns the fade curve used for the clip fade-in.

      Returns FadeCurveEnum

      The configured fade-in curve.

    • Returns the configured fade-in duration.

      Returns number

      The fade-in duration in seconds.

    • Returns the fade curve used for the clip fade-out.

      Returns FadeCurveEnum

      The configured fade-out curve.

    • Returns the configured fade-out duration.

      Returns number

      The fade-out duration in seconds.

    • Indicates whether the clip 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.

    • Indicates whether the clip has a non-empty user-visible name.

      Returns boolean

      true if a name is set; otherwise false.

    • Indicates whether the clip exposes a sprite that can be added to the render stage.

      Returns boolean

      true in the base implementation. Sprite-less subclasses can override this.

    • Tests whether a screen-space point falls inside the clip's local bounds.

      Parameters

      • point: { cursorX: number; cursorY: number }

        Screen-space cursor coordinates.

      • OptionalignoreVisibility: boolean

        When true, performs the hit test even if the sprite is not currently visible.

      Returns boolean

      true if the point hits the clip; otherwise false.

    • Creates the backing video and optional split-audio elements, binds media data, and initializes runtime playback state.

      Parameters

      • layerId: string

        Layer ID that owns this clip.

      Returns Promise<void>

      A promise that resolves after initialization completes.

    • Indicates whether the clip is active on the specified timeline frame.

      Parameters

      • currentTime: number

        Timeline time in seconds.

      Returns boolean

      true if the current frame falls within the clip playback bounds; otherwise false.

    • Indicates whether the clip audio is muted.

      Returns boolean

      true if the clip is muted; otherwise false.

    • Indicates whether the clip has enough runtime state to render and update.

      Returns boolean

      true when the clip is idle or loaded; otherwise false.

    • Moves the clip forward or backward on the timeline by the provided offset.

      Parameters

      • amount: number

        Time delta in seconds.

      Returns void

      Nothing.

    • Pauses clip playback and seeks media elements back to the requested timeline time.

      Parameters

      • currentTime: number

        Current timeline time in seconds.

      Returns Promise<void>

      A promise that resolves after pause handling completes.

    • Primes the clip for timeline playback and seeks media elements to the requested time.

      Parameters

      • currentTime: number

        Current timeline time in seconds.

      Returns Promise<void>

      A promise that resolves after playback pre-roll work completes.

    • Cleans up clip state after an export render pass finishes.

      Parameters

      • canceled: boolean

        Whether the render was canceled before completion.

      Returns Promise<void>

      A promise that resolves after render cleanup completes.

    • Prepares the clip for export rendering, including decoder/player mode setup.

      Parameters

      • options: ExportOptions

        Export options for the current render pass.

      Returns Promise<void>

      A promise that resolves after render-start preparation completes.

    • Parameters

      • width: number
      • height: number

      Returns Promise<void>

    • Parameters

      • currentTime: number

        The current time of the timeline

      Returns void

      This is called after all the clips have been rendered in the preview, useful if you want to change some other clip states after rendering

    • Preloads the clip by seeking the media elements near the requested timeline time.

      Parameters

      • currentTime: number

        Current timeline time in seconds.

      Returns void

      Nothing.

    • Removes a previously attached clip mask.

      Parameters

      • clip: Clip

        Mask source clip to detach.

      Returns void

      Nothing.

    • Parameters

      • id: string

      Returns void

    • Parameters

      • id: string

      Returns void

    • Clears any frozen playback time and resumes normal timeline-driven seeking.

      Returns void

      Nothing.

    • Removes any subtitles association from the clip.

      Returns void

      Nothing.

    • Parameters

      • currentTime: number

      Returns void

    • Resets every animated clip property back to its non-animated base value.

      Returns void

      Nothing.

    • Resets a single animated property back to its base clip/style value.

      Parameters

      • property: string

        Registered animation property key.

      Returns void

      Nothing.

    • Serializes the video clip.

      Returns {
          animationController?: {
              animationDataIn?: {
                  amplification?: number;
                  inOutOfRange: OutOfRangeEnum;
                  name: string;
                  offset?: number;
                  outOutOfRange: OutOfRangeEnum;
                  propertyAnimations: {
                      inOutOfRange: OutOfRangeEnum;
                      keyframes: {
                          easing: EasingEnum;
                          relativeProperty?: string;
                          space: AnimationSpaceEnum;
                          time: number;
                          value: string | number;
                      }[];
                      outOutOfRange: OutOfRangeEnum;
                      property: string;
                  }[];
                  speed?: number;
              };
              animationDataLoop?: {
                  amplification?: number;
                  inOutOfRange: OutOfRangeEnum;
                  name: string;
                  offset?: number;
                  outOutOfRange: OutOfRangeEnum;
                  propertyAnimations: {
                      inOutOfRange: OutOfRangeEnum;
                      keyframes: {
                          easing: EasingEnum;
                          relativeProperty?: string;
                          space: AnimationSpaceEnum;
                          time: number;
                          value: string
                          | number;
                      }[];
                      outOutOfRange: OutOfRangeEnum;
                      property: string;
                  }[];
                  speed?: number;
              };
              animationDataOut?: {
                  amplification?: number;
                  inOutOfRange: OutOfRangeEnum;
                  name: string;
                  offset?: number;
                  outOutOfRange: OutOfRangeEnum;
                  propertyAnimations: {
                      inOutOfRange: OutOfRangeEnum;
                      keyframes: {
                          easing: EasingEnum;
                          relativeProperty?: string;
                          space: AnimationSpaceEnum;
                          time: number;
                          value: string
                          | number;
                      }[];
                      outOutOfRange: OutOfRangeEnum;
                      property: string;
                  }[];
                  speed?: number;
              };
              animationInDuration: number;
              animationLoopCount: number;
              animationOutDuration: number;
              loopSmoothing: number;
          };
          blendMode?: NORMAL
          | ADD
          | SCREEN
          | MULTIPLY;
          clipMasks?: { clipId: string; id: string; wrapMode: MaskWrapModeEnum }[];
          customData?: [string, unknown][];
          duration: number;
          effects: any[];
          filters: {
              clipId?: string;
              filterId: string;
              id: string;
              intensity: number;
              provider: string;
          }[];
          freezeTime?: number;
          id: string;
          isVisible: boolean;
          leftTrim: number;
          mediaDataId: string;
          muted?: boolean;
          name?: string;
          perservePitch: boolean;
          playbackSpeed: number;
          propertyAnimator?: {
              initialValues?: [string, string | number | boolean | number[]][];
              tracks: {
                  customData?: [string, unknown][];
                  defaults?: {
                      handleIn?: { time: number; value: number };
                      handleOut?: { time: number; value: number };
                      hold?: boolean;
                  };
                  keyframes: {
                      handleIn: { time: number; value: number };
                      handleOut: { time: number; value: number };
                      hold?: boolean;
                      time: number;
                      value: (string | number | boolean | number[]) & (
                          undefined
                          | string
                          | number
                          | boolean
                          | number[]
                      );
                  }[];
                  property: string;
                  type: PropertyDescriptionTypeEnum;
              }[];
          };
          rightTrim: number;
          startTime: number;
          style?: unknown;
          subtitlesId?: string;
          subtitlesOffset: number;
          text?: string;
          type: string;
          volume?: number;
          volumeFadeInCurve: FadeCurveEnum;
          volumeFadeInDuration: number;
          volumeFadeOutCurve: FadeCurveEnum;
          volumeFadeOutDuration: number;
          wrapMode?: CLAMP
          | REPEAT
          | PING_PONG
          | EMPTY;
      }

      The serialized video clip payload.

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

      Parameters

      • data: Map<string, unknown>

        Metadata entries to store.

      Returns void

      Nothing.

    • Applies a single animated property value to the clip runtime state.

      Parameters

      • property: string

        Registered animation property key.

      • value: any

        Value to apply.

      Returns void

      Nothing.

    • Sets the clip blend mode and applies the matching PIXI blend mode.

      Parameters

      Returns void

      Nothing.

    • Stores arbitrary metadata on the clip.

      Parameters

      • key: string

        Metadata key.

      • value: unknown

        Metadata value.

      • overwrite: boolean = true

        Whether an existing key may be overwritten.

      Returns boolean

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

    • Freezes video playback to a fixed local media time.

      Parameters

      • Optionaltime: number

        Local media time in seconds, or undefined to clear the freeze.

      Returns void

      Nothing.

    • Marks whether the clip is currently inside an incoming transition.

      Parameters

      • insideTransition: boolean

        Whether the clip participates in an incoming transition.

      Returns void

      Nothing.

    • Marks whether the clip is currently inside an outgoing transition.

      Parameters

      • insideTransition: boolean

        Whether the clip participates in an outgoing transition.

      Returns void

      Nothing.

    • Updates the owning layer ID tracked by the clip.

      Parameters

      • layerId: string

        Owning layer ID.

      Returns void

      Nothing.

    • Parameters

      • trim: number

      Returns void

    • Mutes or unmutes the clip audio output.

      Parameters

      • muted: boolean

        Whether the clip should be muted.

      Returns void

      Nothing.

    • Sets the user-visible clip name.

      Parameters

      • name: string

        Name to assign.

      Returns void

      Nothing.

    • Sets whether pitch correction should be preserved while changing playback speed.

      Parameters

      • perservePitch: boolean

        Whether pitch should be preserved.

      Returns void

      Nothing.

    • Changes video playback speed and updates duration and trims to preserve the requested timing behavior.

      Parameters

      • speed: number

        Playback speed multiplier.

      • perserveLeftBound: boolean = true

        When true, keeps the visible left edge fixed in timeline space.

      • perserveTrimmedDuration: boolean = false

        When true, preserves the trimmed visible duration after the speed change.

      Returns void

      Nothing.

    • Parameters

      • trim: number

      Returns void

    • Parameters

      • startTime: number

      Returns void

    • Associates a subtitles asset with the clip and stores its playback offset.

      Parameters

      • subtitlesId: string

        Subtitles asset ID to attach.

      • offset: number = 0

        Global subtitles offset in seconds.

      Returns void

      Nothing.

    • Replaces the subtitles asset ID assigned to the clip without changing the stored offset.

      Parameters

      • subtitlesId: string

        Subtitles asset ID to assign.

      Returns void

      Nothing.

    • Sets the stored subtitles offset for the clip.

      Parameters

      • offset: number

        Subtitles offset in seconds.

      Returns void

      Nothing.

    • Sets the incoming transition ID currently associated with the clip.

      Parameters

      • transitionId: null | string

        Incoming transition ID, or null to clear it.

      Returns void

      Nothing.

    • Sets the outgoing transition ID currently associated with the clip.

      Parameters

      • transitionId: null | string

        Outgoing transition ID, or null to clear it.

      Returns void

      Nothing.

    • Sets whether the clip sprite is renderable.

      Parameters

      • visible: boolean

        Whether the clip should render.

      Returns void

      Nothing.

    • Sets the clip volume multiplier.

      Parameters

      • volume: number

        Clip volume multiplier.

      Returns void

      Nothing.

    • Sets the interpolation curve used for the clip fade-in.

      Parameters

      Returns void

      Nothing.

    • Sets the audible fade-in duration at the start of the clip.

      Parameters

      • duration: number

        Fade-in duration in seconds.

      Returns void

      Nothing.

    • Sets the interpolation curve used for the clip fade-out.

      Parameters

      Returns void

      Nothing.

    • Sets the audible fade-out duration at the end of the clip.

      Parameters

      • duration: number

        Fade-out duration in seconds.

      Returns void

      Nothing.

    • Synchronizes video playback, lazy loading, visibility, and effect state with the timeline playhead.

      Parameters

      • currentTime: number

        Current timeline time in seconds.

      Returns void

      Nothing.

    • Rebinds the clip to updated video media and refreshes derived timing, render mode, textures, and optional split-audio state.

      Parameters

      • OptionalnewMediaId: string

        Optional replacement media asset ID.

      • Optionaloptions: ReplaceMediaOptions

        Optional media replacement behavior such as fit and crop handling.

      Returns Promise<boolean>

      A promise that resolves to true if the media update succeeds; otherwise false.

    • Parameters

      • currentTime: number

      Returns void

    • Creates a video clip instance from serialized data.

      Parameters

      • payload: object

        Serialized video clip payload.

      Returns VideoClip

      The deserialized video clip.