import { ContextManager, Observable, PlayOptions, Stream } from '@zcomponent/core'; import * as THREE from 'three'; import { Texture, TextureConstructorProps } from './Texture'; /** * The properties for constructing a video texture. */ interface VideoTextureConstructorProps extends TextureConstructorProps { /** * The source video file. * This can be a local file or a URL to an mp4 file. * @zprop * @zvalues files *.+(mp4) */ source: string; /** * Start playing the video automatically when the scene starts. * @zprop * @zdefault false */ autoplay?: boolean; /** * The audio layer for the video. * @zprop * @zdefault default */ audioLayer?: string; /** * Whether to use the legacy audio system. * @zprop * @zdefault false */ legacyAudio?: boolean; } /** * * Extends the Texture component to provide functionality for creating and managing video textures. * * This component enables the use of video files as textures in 3D scenes, supporting features like autoplay, audio layers, and legacy audio. * * * @zcomponent * @zgroup Texture * @zicon movie * @ztag three/Texture/VideoTexture * @zparents three/Material/** * @zstream */ export declare class VideoTexture extends Texture implements Stream { private videoElement; private _hadUserEvent; private _gain; /** * Observable property to control the muted state of the video. * When set to true, the video plays without sound. * @zprop * @zdefault false * @zgroup VideoTexture * @zgrouppriority 20 */ muted: Observable; /** * Creates an instance of VideoTexture. * @param mgr - The context manager.s * @param props VideoTextureConstructorProps to define the properties of the video texture. */ constructor(mgr: ContextManager, props: VideoTextureConstructorProps); /** * Disposes of the video texture. */ dispose(): never; private _updateMute; /** * The volume of the video. * @zprop * @ztype proportion * @zdefault 1 */ volume: Observable; /** * Plays the video. * @zprop **/ play(opts?: PlayOptions): void; /** * Pauses the video. * @zprop * */ pause(): void; /** * Stops the video and resets the current time to 0. * @zprop * */ stop(): void; /** * Seeks to the specified time in milliseconds. * @zprop */ seek(t: number): void; /** * @returns The current time in milliseconds. */ currentTime(): number; /** * * @returns The length of the video in milliseconds. */ length(): number | undefined; /** * * @returns Whether the video is currently playing. */ stalled(): boolean; /** * Whether the video should loop. * @zprop * @zdefault false * @zgroup VideoTexture * @zgrouppriority 20 */ loop: Observable; } export {};