Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jazzfool/iced_video_player
Video player component for Iced
https://github.com/jazzfool/iced_video_player
Last synced: 1 day ago
JSON representation
Video player component for Iced
- Host: GitHub
- URL: https://github.com/jazzfool/iced_video_player
- Owner: jazzfool
- License: apache-2.0
- Created: 2020-08-19T13:07:57.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2024-04-13T03:31:17.000Z (7 months ago)
- Last Synced: 2024-04-24T07:36:38.787Z (7 months ago)
- Language: Rust
- Size: 11.1 MB
- Stars: 68
- Watchers: 2
- Forks: 13
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
- awesome-iced - iced_video_player - Composable component to play videos in an iced app leveraging GStreamer. (Custom Widgets)
README
# Iced Video Player Widget
Composable component to play videos in any Iced application built on the excellent GStreamer library.
## Overview
In general, this supports anything that [`gstreamer/playbin`](https://gstreamer.freedesktop.org/documentation/playback/playbin.html?gi-language=c) supports.
Features:
- Load video files from any file path **or URL** (support for streaming over network).
- Video buffering when streaming on a network.
- Audio support.
- Programmatic control.
- Can capture thumbnails from a set of timestamps.
- Good performance (i.e., comparable to other video players). GStreamer (with the right plugins) will perform hardware-accelerated decoding, and the color space (YUV to RGB) is converted on the GPU whilst rendering the frame.Limitations (hopefully to be fixed):
- GStreamer is a bit annoying to set up on Windows.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.## Example Usage
```rust
use iced_video_player::{Video, VideoPlayer};fn main() -> iced::Result {
iced::run("Video Player", (), App::view)
}struct App {
video: Video,
}impl Default for App {
fn default() -> Self {
App {
video: Video::new(&url::Url::parse("file:///C:/my_video.mp4").unwrap()).unwrap(),
}
}
}impl App {
fn view(&self) -> iced::Element<()> {
VideoPlayer::new(&self.video).into()
}
}
```## Building
Follow the [GStreamer build instructions](https://github.com/sdroege/gstreamer-rs#installation). This should be able to compile on MSVC, MinGW, Linux, and MacOS.
## License
Licensed under either
- [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0)
- [MIT](http://opensource.org/licenses/MIT)at your option.