API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
classVideo
Renders an `HTMLVideoElement` as a live texture on a Sprite. `Video` wraps a video element, manages playback (play/pause/stop/seek, volume, loop, playback rate), and keeps the underlying Texture in sync with the decoded video frame stream via `requestVideoFrameCallback` (falling back to `currentTime` polling on browsers that lack it). Audio is routed through the Web Audio API gain node and can be directed to any AudioBus.
import { Video } from '@codexo/exojs' Renders an `HTMLVideoElement` as a live texture on a Sprite.
`Video` wraps a video element, manages playback (play/pause/stop/seek, volume, loop, playback rate), and keeps the underlying Texture in sync with the decoded video frame stream via `requestVideoFrameCallback` (falling back to `currentTime` polling on browsers that lack it). Audio is routed through the Web Audio API gain node and can be directed to any AudioBus.
new(videoElement: HTMLVideoElement, playbackOptions?: Partial<PlaybackOptions>, samplerOptions?: Partial<SamplerOptions>): Video _invalidateChildrenTransform(): void addFilter(filter: Filter): this applyOptions(options: Partial<PlaybackOptions>): this clearFilters(): this collidesWith(target: Collidable): CollisionResponse | null contains(x: number, y: number): boolean destroy(): void getBounds(): Rectangle getGlobalTransform(): Matrix getLocalBounds(): Rectangle getNormals(): Vector[] getTime(): number getTransform(): Matrix intersectsWith(target: Collidable): boolean invalidateCache(): this inView(view: View): boolean move(x: number, y: number): this pause(options?: Partial<PlaybackOptions>): this play(options?: Partial<PlaybackOptions>): this project(axis: Vector, result: Interval): Interval removeFilter(filter: Filter): this render(backend: RenderBackend): this resetTextureFrame(): this rotate(degrees: number): this setAnchor(x: number, y: number): this setBlendMode(blendMode: BlendModes): this setLoop(loop: boolean): this setMuted(muted: boolean): this setOrigin(x: number, y: number): this setPlaybackRate(value: number): this setPosition(x: number, y: number): this setRotation(degrees: number): this setScale(x: number, y: number): this setSkew(x: number, y: number): this setTexture(texture: RenderTexture | Texture | null): this setTextureFrame(frame: Rectangle, resetSize: boolean): this setTime(time: number): this setTint(color: Color): this setVolume(value: number): this stop(options?: Partial<PlaybackOptions>): this toggle(options?: Partial<PlaybackOptions>): this updateBounds(): this updateParentTransform(): this updateTexture(): this updateTransform(): this setInternalSpriteFactory(factory: object | null): void clip: boolean clipShape: Rectangle | Geometry | null collisionType: CollisionType cursor: string | null draggable: boolean flags: Flags<SceneNodeTransformFlags> preserveDrawOrder: boolean analyserTarget: AudioNode | null anchor: ObservableVector blendMode: BlendModes bus: AudioBus cacheAsBitmap: boolean cullable: boolean currentTime: number duration: number filters: readonly Filter[] height: number interactive: boolean isAlignedBox: boolean loop: boolean mask: MaskSource material: SpriteMaterial | null muted: boolean origin: ObservableVector parent: Container | null paused: boolean pixelSnapMode: PixelSnapMode playbackRate: number playing: boolean position: ObservableVector progress: number rotation: number scale: ObservableVector skewX: number skewY: number texCoords: Uint32Array texture: RenderTexture | Texture | null textureFrame: Rectangle tint: Color vertices: Float32Array videoElement: HTMLVideoElement visible: boolean volume: number width: number x: number y: number zIndex: number onDrag: Signal<[InteractionEvent]> onDragEnd: Signal<[InteractionEvent]> onDragStart: Signal<[InteractionEvent]> onPointerDown: Signal<[InteractionEvent]> onPointerMove: Signal<[InteractionEvent]> onPointerOut: Signal<[InteractionEvent]> onPointerOver: Signal<[InteractionEvent]> onPointerTap: Signal<[InteractionEvent]> onPointerUp: Signal<[InteractionEvent]> onStart: Signal<[]> onStop: Signal<[]>