Type / Trait | Description |
|---|---|
Platform | Enum with variants Desktop, Web, Mobile, and Test. Used for platform-conditional logic in widgets and renderers. |
VideoBackend | Trait for creating VideoPlayer instances and presenting video surface frames at their laid-out rectangles. |
VideoPlayer | Trait for controlling a single video stream -- play, pause, stop, seek, volume, rate, and polling for VideoEvent updates. |
VideoSurfaceFrame | Struct carrying a WidgetId, a surface_id, and a LayoutRect so the compositor knows where to place a native video surface. |
VideoEvent | Enum for events emitted by a VideoPlayer: Ready { duration }, Ended, and Error(String). |
use fission_shell::{Platform, VideoBackend, VideoPlayer};
fn create_player(backend: &dyn VideoBackend) {
let mut player = backend.create_player("https://example.com/video.mp4");
player.play();
// Poll for readiness
for event in player.poll_events() {
println!("{:?}", event);
}
}
Type / Trait | Description |
|---|---|
Platform | Enum with variants Desktop, Web, Mobile, and Test. Used for platform-conditional logic in widgets and renderers. |
VideoBackend | Trait for creating VideoPlayer instances and presenting video surface frames at their laid-out rectangles. |
VideoPlayer | Trait for controlling a single video stream -- play, pause, stop, seek, volume, rate, and polling for VideoEvent updates. |
VideoSurfaceFrame | Struct carrying a WidgetId, a surface_id, and a LayoutRect so the compositor knows where to place a native video surface. |
VideoEvent | Enum for events emitted by a VideoPlayer: Ready { duration }, Ended, and Error(String). |
use fission_shell::{Platform, VideoBackend, VideoPlayer};
fn create_player(backend: &dyn VideoBackend) {
let mut player = backend.create_player("https://example.com/video.mp4");
player.play();
// Poll for readiness
for event in player.poll_events() {
println!("{:?}", event);
}
}