Struct medea_jason::Track[][src]

pub struct Track(_);

Wrapper around MediaStreamTrack received from the remote.

Implementations

impl Track[src]

#[must_use]pub fn new<T>(
    track: T,
    media_source_kind: MediaSourceKind,
    enabled: bool,
    muted: bool
) -> Self where
    MediaStreamTrack: From<T>, 
[src]

Creates a new Track.

Panics

If provided sys::MediaStreamTrack kind is not audio or video.

pub fn set_enabled(&self, enabled: bool)[src]

Sets enabled property on this Track.

Calls on_enabled or or_disabled callback respectively.

Updates enabled property in the underlying sys::MediaStreamTrack.

pub fn set_muted(&self, muted: bool)[src]

Sets muted property on this Track.

Calls on_muted or or_unmuted callback respectively.

Updates enabled property in the underlying sys::MediaStreamTrack.

#[must_use]pub fn id(&self) -> String[src]

Returns id of underlying sys::MediaStreamTrack of this Track.

#[must_use]pub fn kind(&self) -> MediaKind[src]

Returns this Track’s kind (audio/video).

#[must_use]pub fn media_source_kind(&self) -> MediaSourceKind[src]

Returns this Track’s media source kind.

pub fn stop(self)[src]

Stops this Track invoking an on_stopped callback if it’s in a sys::MediaStreamTrackState::Live state.

impl Track[src]

#[must_use]pub fn get_track(&self) -> MediaStreamTrack[src]

Returns the underlying sys::MediaStreamTrack of this Track.

#[must_use]pub fn js_enabled(&self) -> bool[src]

Indicate whether this Track is enabled.

#[must_use]pub fn muted(&self) -> bool[src]

Indicate whether this Track is muted.

pub fn on_enabled(&self, callback: Function)[src]

Sets callback to invoke when this Track is enabled.

pub fn on_disabled(&self, callback: Function)[src]

Sets callback to invoke when this Track is disabled.

pub fn on_stopped(&self, callback: Function)[src]

Sets callback to invoke when this Track is stopped.

pub fn on_muted(&self, callback: Function)[src]

Sets callback to invoke when this Track is muted.

pub fn on_unmuted(&self, callback: Function)[src]

Sets callback to invoke when this Track is unmuted.

#[must_use]pub fn js_kind(&self) -> MediaKind[src]

Returns MediaKind::Audio if this Track represents an audio track, or MediaKind::Video if it represents a video track.

#[must_use]pub fn js_media_source_kind(&self) -> JsMediaSourceKind[src]

Returns JsMediaSourceKind::Device if this Track is sourced from some device (webcam/microphone), or JsMediaSourceKind::Display if it’s captured via MediaDevices.getDisplayMedia().

Trait Implementations

impl Clone for Track[src]

impl From<Track> for JsValue[src]

impl FromWasmAbi for Track[src]

type Abi = u32

The wasm ABI type that this converts from when coming back out from the ABI boundary. Read more

impl IntoWasmAbi for Track[src]

type Abi = u32

The wasm ABI type that this converts into when crossing the ABI boundary. Read more

impl OptionFromWasmAbi for Track[src]

impl OptionIntoWasmAbi for Track[src]

impl RefFromWasmAbi for Track[src]

type Abi = u32

The wasm ABI type references to Self are recovered from.

type Anchor = Ref<'static, Track>

The type that holds the reference to Self for the duration of the invocation of the function that has an &Self parameter. This is required to ensure that the lifetimes don’t persist beyond one function call, and so that they remain anonymous. Read more

impl RefMutFromWasmAbi for Track[src]

type Abi = u32

Same as RefFromWasmAbi::Abi

type Anchor = RefMut<'static, Track>

Same as RefFromWasmAbi::Anchor

impl WasmDescribe for Track[src]

Auto Trait Implementations

impl !RefUnwindSafe for Track

impl !Send for Track

impl !Sync for Track

impl Unpin for Track

impl !UnwindSafe for Track

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ReturnWasmAbi for T where
    T: IntoWasmAbi
[src]

type Abi = <T as IntoWasmAbi>::Abi

Same as IntoWasmAbi::Abi

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<E> WrapTraced<E> for E[src]