ThorVG WebCanvas API - v1.1.4
    Preparing search index...

    Class VideoBeta

    Video controller. The Video owns a Picture internally and manages frame updates

    const video = new TVG.Video();
    canvas.add(video);

    const bytes = new Uint8Array(await (await fetch('/clip.mp4')).arrayBuffer());
    await video.load(bytes);
    video.picture?.size(800, 600);
    video.loop(true).play();
    Index
    canvas: Canvas | null = null
    • get picture(): Picture | null
      Beta

      Get the Picture object that contains the video frames. This Picture is owned by the Video and should not be manually disposed.

      Returns Picture | null

    • get isDisposed(): boolean
      Beta

      Check if this object has been disposed

      Returns boolean

    • Beta

      Load video from raw data.

      Parameters

      • data: ArrayBuffer | Uint8Array<ArrayBufferLike>

        Video file bytes

      Returns Promise<void>

      A promise that resolves when the video is ready, or rejects on a decode error.

    • Beta

      Start or resume playback.

      Parameters

      • OptionalonFrame: (time: number) => void

        Optional callback invoked on each frame update

      Returns this

    • Beta

      Enable or disable repeated playback.

      Parameters

      • on: boolean

      Returns this

    • Beta

      Seek to a specific time (in seconds)

      Parameters

      • time: number

      Returns this

    • Beta

      Get or set the audio volume level in the range [0.0, 1.0].

      Returns number

    • Beta

      Get or set the audio volume level in the range [0.0, 1.0].

      Parameters

      • value: number

      Returns this

    • Beta

      Mute or unmute the audio.

      Parameters

      • on: boolean

      Returns this

    • Beta

      Dispose of the video, its worker and WASM resources.

      Returns void