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::Tracks, so if there are no strong references to some track, then this track is stopped and deleted from MediaManager.

Implementations§

source§

impl MediaManagerHandle

source

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.

source

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.

source

pub async fn init_local_tracks( &self, caps: MediaStreamSettings ) -> Result<Vec<LocalMediaTrack>, Traced<InitLocalTracksError>>

Returns local::LocalMediaTracks objects, built from the provided MediaStreamSettings.

Errors

See InitLocalTracksError for details.

source

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.

source

pub async fn set_microphone_volume( &self, level: i64 ) -> Result<(), Traced<MicVolumeError>>

Sets the microphone volume level in percents.

Errors

See MicVolumeError for details.

source

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.

source

pub async fn microphone_volume(&self) -> Result<i64, Traced<MicVolumeError>>

Returns the current microphone volume level in percents.

Errors

See MicVolumeError for details.

source

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

source§

fn clone(&self) -> MediaManagerHandle

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for MediaManagerHandle

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl RefUnwindSafe for MediaManagerHandle

source§

impl UnwindSafe for MediaManagerHandle

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<E> WrapTraced<E> for E

source§

fn wrap_traced(self, f: Frame) -> Traced<E>

Wraps this error into a Traced wrapper, storing the given Frame of a Trace inside.
source§

impl<T> DartSafe for Twhere T: UnwindSafe + RefUnwindSafe,