video
Video playback for local files and URLs, decoded by the glyx-media library
(ffmpeg-backed) on a dedicated thread and composited like any other GPU image.
Use the <Video> component for declarative playback, or the video API for
manual control.
Requires the video capability:
glyx.config.json
{ "capabilities": { "video": true } }Video decoding uses the glyx-media DLL, downloaded once via
glyx runtime build. If it isn't present, calls reject with
GlyxMediaNotAvailable instead of crashing.
Quick start
import { Video } from '@glyx-dev/react'
<Video
src="./assets/intro.mp4"
autoPlay
loop
muted
style={{ width: 800, height: 450, borderRadius: 8 }}
/><Video> props
| Prop | Type | Description |
|---|---|---|
src | string | File path or URL |
autoPlay | boolean | Start playback on mount |
loop | boolean | Restart when playback ends |
muted | boolean | Open with volume 0 |
style | ViewStyle | Layout/style |
ref | Ref | Exposes the playback handle for the video API |
API
video.open(url, callbacks?)
Opens a video and starts decoding. Returns Promise<number> — the handle for
all other calls. Optional callbacks:
const handle = await video.open('./movie.mp4', {
onMetadata: ({ width, height, fps, durationSecs }) => {},
onTimeUpdate: (seconds) => {},
onEnded: () => {},
onError: (message) => {},
})video.play(handle) / video.pause(handle)
Resume/pause the decode and audio threads.
video.seek(handle, seconds)
Seek to an absolute position. Values below 0 are clamped.
video.setVolume(handle, volume)
0.0 = mute, 1.0 = normal, up to 2.0.
video.close(handle)
Stops playback and releases the decoder, audio sink, and GPU frames.