pub trait RoomExt: Sealed {
// Required method
fn watch(&self, peer: EndpointId, name: &str) -> RemoteBroadcast;
}Expand description
Reads a room member’s broadcast as media.
The trait is sealed: only [Room] implements it.
§Examples
use iroh_live::media::{PlayerConfig, RoomExt};
let player = room.watch(peer, "cam").play(PlayerConfig::default())?;Required Methods§
Sourcefn watch(&self, peer: EndpointId, name: &str) -> RemoteBroadcast
fn watch(&self, peer: EndpointId, name: &str) -> RemoteBroadcast
Returns member peer’s broadcast name, subscribing again while the member lists it.
Follows the member through [Room::subscriptions]: subscribes once
the member lists name, however long that takes, and again after
each end of the subscription while the member still lists it, such
as when the member restarts its broadcast or the session with it
fails. Players switch to each new subscription and adapt to the link
that serves it.
The broadcast closes once the member stops listing name after it
did, the room is left, or the room’s last handle drops: the watched
broadcast does not keep the room joined. A member that never lists
name leaves the broadcast waiting, so bound the wait if that can
happen. The catalog arrives later: watch RemoteBroadcast::catalog
for it.
§Panics
Panics when called outside a Tokio runtime.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".