Skip to main content

Crate freya_video

Crate freya_video 

Source
Expand description

Video playback for Freya, backed by ffmpeg and rodio.

  • use_video: a hook that decodes a video into reactive state and returns a VideoPlayer to 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§

VideoClient
Decoding pipeline for one video. Drop to stop.
VideoPlayer
Reactive handle to a video decoding pipeline.
VideoSource
Source of a video to decode.

Enums§

PlaybackState
Current playback state of a VideoPlayer.
VideoEvent
Event emitted by a VideoClient.

Functions§

ensure_ffmpeg
Download an ffmpeg binary if one isn’t already available on PATH. Call from main before launch() to opt in to auto-install.
use_video
Create a VideoPlayer and start playing video_source().