pub struct Player { /* private fields */ }Expand description
A simple video player: one source playing to one output.
Player wraps the Compositor for the common case of playing a single video file to a single output (monitor or texture). For more complex multi-source or multi-output scenarios, use Compositor directly.
§Rendering
Player renders to a wgpu texture, which the host application can composite into its own scene. The close button is rendered as a UI overlay stub.
Implementations§
Source§impl Player
impl Player
Sourcepub fn from_file<P: AsRef<Path>>(
path: P,
width: u32,
height: u32,
) -> Result<Self>
pub fn from_file<P: AsRef<Path>>( path: P, width: u32, height: u32, ) -> Result<Self>
Create a player for a single video file.
The output defaults to the full monitor/screen size.
Sourcepub fn advance(&mut self, delta: Duration) -> Result<()>
pub fn advance(&mut self, delta: Duration) -> Result<()>
Advance playback by the given delta time.
Sourcepub fn render(&mut self) -> Result<()>
pub fn render(&mut self) -> Result<()>
Render the current frame to an output texture.
In Phase 1, this is stubbed. Full implementation would composite layers to the output texture and render the close button UI.
Sourcepub fn compositor_mut(&mut self) -> &mut Compositor
pub fn compositor_mut(&mut self) -> &mut Compositor
Get mutable access to the underlying compositor for advanced control.
Sourcepub fn compositor(&self) -> &Compositor
pub fn compositor(&self) -> &Compositor
Get immutable access to the underlying compositor.
Sourcepub fn video_source_id(&self) -> &str
pub fn video_source_id(&self) -> &str
Get the video source ID (for reference).
Sourcepub fn output(&self) -> Option<&Output>
pub fn output(&self) -> Option<&Output>
Get the current output (for inspection or modification).
Sourcepub fn output_mut(&mut self) -> Option<&mut Output>
pub fn output_mut(&mut self) -> Option<&mut Output>
Get the current output (mutable).