Crates.io | iced_video_player |
lib.rs | iced_video_player |
version | 0.1.3 |
source | src |
created_at | 2024-02-19 04:13:49.569208 |
updated_at | 2024-02-19 06:20:32.693723 |
description | A convenient video player widget for Iced |
homepage | https://github.com/jazzfool/iced_video_player |
repository | https://github.com/jazzfool/iced_video_player |
max_upload_size | |
id | 1144702 |
size | 984,083 |
Composable component to play videos in any Iced application built on the excellent GStreamer library.
In general, this supports anything that gstreamer/playbin
supports.
Features:
Image
and copies frame data directly to a WGPU texture, and renders using a custom WGPU render pipeline.
For a very subjective reference, I can play back 1080p HEVC video with hardware decoding without hitches, in debug mode.Limitations (hopefully to be fixed):
The player does not come with any surrounding GUI controls, but they should be quite easy to implement should you need them. See the "minimal" example for a demonstration on how you could implement pausing, looping, and seeking.
use iced_video_player::{Video, VideoPlayer};
use iced::{Sandbox, Element};
fn main() {
App::run(Default::default());
}
struct App {
video: Video,
}
impl Sandbox for App {
type Message = ();
fn new() -> Self {
App {
video: Video::new(&url::Url::parse("file:///C:/my_video.mp4").unwrap()).unwrap(),
}
}
fn title(&self) -> String {
String::from("Video Player")
}
fn update(&mut self, _message: ()) {}
fn view(&mut self) -> Element<()> {
VideoPlayer::new(&self.video).into()
}
}
Follow the GStreamer build instructions. This should be able to compile on MSVC, MinGW, Linux, and MacOS.
Licensed under either
at your option.