Expand description
Video playback for Freya, backed by ffmpeg and rodio.
use_video: a hook that decodes a video into reactive state and returns aVideoPlayerto control playback.
Render the current frame yourself with the image() element from player.frame().
Call ensure_ffmpeg once before launch() to auto-download an ffmpeg binary.
This crate is reexported in freya::video.
§Example
use freya::{
elements::image::image,
prelude::*,
video::*,
};
fn app() -> impl IntoElement {
let player = use_video(|| "video.mp4");
rect().maybe_child(player.frame().map(image))
}Structs§
- Video
Client - Decoding pipeline for one video. Drop to stop.
- Video
Player - Reactive handle to a video decoding pipeline.
- Video
Source - Source of a video to decode.
Enums§
- Playback
State - Current playback state of a
VideoPlayer. - Video
Event - Event emitted by a
VideoClient.
Functions§
- ensure_
ffmpeg - Download an ffmpeg binary if one isn’t already available on
PATH. Call frommainbeforelaunch()to opt in to auto-install. - use_
video - Create a
VideoPlayerand start playingvideo_source().