← Todos los crates de Fission

fission-shell

Shared shell runtime contracts for hosting Fission applications
0.16.0 · android · ios · linux · macos · windows · web · terminal · static-site · ssr
Ver paquetes publicados en crates.io
Repositorio del código

fission-shell

Shared shell abstractions for the Fission UI framework.
fission-shell defines the platform-agnostic traits and types that every Fission shell backend (desktop, web, mobile, test) implements. It provides the Platform enum for identifying the current target, the VideoBackend and VideoPlayer traits for native video playback, and theVideoSurfaceFrame struct for compositing video surfaces into the Fission layout tree.

Key types

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).

Usage example

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);
    }
}

Status

Supported -- stable traits consumed by fission-shell-desktop, rendering backends, and the test harness.

License

Apache-2.0 -- see the Fission repository for full documentation at https://fission.rs.