Struct rust_cast::channels::media::MediaChannel
[−]
[src]
pub struct MediaChannel<'a, W> where
W: Read + Write, { /* fields omitted */ }
Methods
impl<'a, W> MediaChannel<'a, W> where
W: Read + Write,
[src]
W: Read + Write,
pub fn new<S>(
sender: S,
message_manager: Rc<MessageManager<W>>
) -> MediaChannel<'a, W> where
S: Into<Cow<'a, str>>,
[src]
sender: S,
message_manager: Rc<MessageManager<W>>
) -> MediaChannel<'a, W> where
S: Into<Cow<'a, str>>,
pub fn get_status<S>(
&self,
destination: S,
media_session_id: Option<i32>
) -> Result<Status, Error> where
S: Into<Cow<'a, str>>,
[src]
&self,
destination: S,
media_session_id: Option<i32>
) -> Result<Status, Error> where
S: Into<Cow<'a, str>>,
Retrieves status of the cast device media session.
Arguments
destination
-protocol
identifier of specific app media session;media_session_id
- Media session ID of the media for which the media status should be returned. If none is provided, then the status for all media session IDs will be provided.
Return value
Returned Result
should consist of either Status
instance or an Error
.
pub fn load<S>(
&self,
destination: S,
session_id: S,
media: &Media
) -> Result<Status, Error> where
S: Into<Cow<'a, str>>,
[src]
&self,
destination: S,
session_id: S,
media: &Media
) -> Result<Status, Error> where
S: Into<Cow<'a, str>>,
Loads provided media to the application.
Arguments
destination
-protocol
of the application to load media with (e.g.web-1
);session_id
- Current session identifier of the player application;media
-Media
instance that describes the media we'd like to load.
Return value
Returned Result
should consist of either Status
instance or an Error
.
pub fn pause<S>(
&self,
destination: S,
media_session_id: i32
) -> Result<StatusEntry, Error> where
S: Into<Cow<'a, str>>,
[src]
&self,
destination: S,
media_session_id: i32
) -> Result<StatusEntry, Error> where
S: Into<Cow<'a, str>>,
Pauses playback of the current content. Triggers a STATUS event notification to all sender applications.
Arguments
destination
-protocol
of the media application (e.g.web-1
);media_session_id
- ID of the media session to be paused.
Return value
Returned Result
should consist of either Status
instance or an Error
.
pub fn play<S>(
&self,
destination: S,
media_session_id: i32
) -> Result<StatusEntry, Error> where
S: Into<Cow<'a, str>>,
[src]
&self,
destination: S,
media_session_id: i32
) -> Result<StatusEntry, Error> where
S: Into<Cow<'a, str>>,
Begins playback of the content that was loaded with the load call, playback is continued from the current time position.
Arguments
destination
-protocol
of the media application (e.g.web-1
);media_session_id
- ID of the media session to be played.
Return value
Returned Result
should consist of either Status
instance or an Error
.
pub fn stop<S>(
&self,
destination: S,
media_session_id: i32
) -> Result<StatusEntry, Error> where
S: Into<Cow<'a, str>>,
[src]
&self,
destination: S,
media_session_id: i32
) -> Result<StatusEntry, Error> where
S: Into<Cow<'a, str>>,
Stops playback of the current content. Triggers a STATUS event notification to all sender applications. After this command the content will no longer be loaded and the media_session_id is invalidated.
Arguments
destination
-protocol
of the media application (e.g.web-1
);media_session_id
- ID of the media session to be stopped.
Return value
Returned Result
should consist of either Status
instance or an Error
.
pub fn seek<S>(
&self,
destination: S,
media_session_id: i32,
current_time: Option<f32>,
resume_state: Option<ResumeState>
) -> Result<StatusEntry, Error> where
S: Into<Cow<'a, str>>,
[src]
&self,
destination: S,
media_session_id: i32,
current_time: Option<f32>,
resume_state: Option<ResumeState>
) -> Result<StatusEntry, Error> where
S: Into<Cow<'a, str>>,
Sets the current position in the stream. Triggers a STATUS event notification to all sender applications. If the position provided is outside the range of valid positions for the current content, then the player should pick a valid position as close to the requested position as possible.
Arguments
destination
-protocol
of the media application (e.g.web-1
);media_session_id
- ID of the media session to seek in;current_time
- Time in seconds to seek to.
Return value
Returned Result
should consist of either Status
instance or an Error
.