Struct medea_jason::media::MediaManagerHandle
source · pub struct MediaManagerHandle(_);
Expand description
External handle to a MediaManager
.
MediaManager
performs all media acquisition requests
(getUserMedia()/getDisplayMedia()) and stores all received tracks
for further reusage.
MediaManager
stores weak references to local::Track
s, so if there
are no strong references to some track, then this track is stopped and
deleted from MediaManager
.
Implementations§
source§impl MediaManagerHandle
impl MediaManagerHandle
sourcepub async fn enumerate_devices(
&self
) -> Result<Vec<MediaDeviceInfo>, Traced<EnumerateDevicesError>>
pub async fn enumerate_devices( &self ) -> Result<Vec<MediaDeviceInfo>, Traced<EnumerateDevicesError>>
Returns a list of platform::MediaDeviceInfo
objects representing
available media input and devices, such as microphones, cameras, and so
forth.
Errors
See EnumerateDevicesError
for details.
sourcepub async fn enumerate_displays(
&self
) -> Result<Vec<MediaDisplayInfo>, Traced<EnumerateDisplaysError>>
pub async fn enumerate_displays( &self ) -> Result<Vec<MediaDisplayInfo>, Traced<EnumerateDisplaysError>>
Returns a list of platform::MediaDisplayInfo
objects representing
available displays.
Errors
See EnumerateDisplaysError
for details.
sourcepub async fn init_local_tracks(
&self,
caps: MediaStreamSettings
) -> Result<Vec<LocalMediaTrack>, Traced<InitLocalTracksError>>
pub async fn init_local_tracks( &self, caps: MediaStreamSettings ) -> Result<Vec<LocalMediaTrack>, Traced<InitLocalTracksError>>
Returns local::LocalMediaTrack
s objects, built from the provided
MediaStreamSettings
.
Errors
See InitLocalTracksError
for details.
sourcepub async fn set_output_audio_id(
&self,
device_id: String
) -> Result<(), Traced<InvalidOutputAudioDeviceIdError>>
pub async fn set_output_audio_id( &self, device_id: String ) -> Result<(), Traced<InvalidOutputAudioDeviceIdError>>
Switches the current audio output device to the device with the provided
device_id
.
Errors
With InvalidOutputAudioDeviceIdError
if the provided device_id
is
not available.
sourcepub async fn set_microphone_volume(
&self,
level: i64
) -> Result<(), Traced<MicVolumeError>>
pub async fn set_microphone_volume( &self, level: i64 ) -> Result<(), Traced<MicVolumeError>>
sourcepub async fn microphone_volume_is_available(
&self
) -> Result<bool, Traced<HandleDetachedError>>
pub async fn microphone_volume_is_available( &self ) -> Result<bool, Traced<HandleDetachedError>>
Indicates whether it’s possible to access microphone volume settings.
Errors
If the underlying MediaManagerHandle
is dropped.
sourcepub async fn microphone_volume(&self) -> Result<i64, Traced<MicVolumeError>>
pub async fn microphone_volume(&self) -> Result<i64, Traced<MicVolumeError>>
sourcepub fn on_device_change(
&self,
cb: Function<()>
) -> Result<(), Traced<HandleDetachedError>>
pub fn on_device_change( &self, cb: Function<()> ) -> Result<(), Traced<HandleDetachedError>>
Subscribes onto the devicechange
event of this MediaManagerHandle
.
Errors
If the underlying MediaManagerHandle
is dropped.
Trait Implementations§
source§impl Clone for MediaManagerHandle
impl Clone for MediaManagerHandle
source§fn clone(&self) -> MediaManagerHandle
fn clone(&self) -> MediaManagerHandle
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more