Struct medea_jason::Track [−][src]
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]
track: T,
media_source_kind: MediaSourceKind,
enabled: bool,
muted: bool
) -> Self where
MediaStreamTrack: From<T>,
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
unsafe fn from_abi(js: u32) -> Self
[src]
impl IntoWasmAbi for Track
[src]
type Abi = u32
The wasm ABI type that this converts into when crossing the ABI boundary. Read more
fn into_abi(self) -> u32
[src]
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
unsafe fn ref_from_abi(js: Self::Abi) -> Self::Anchor
[src]
impl RefMutFromWasmAbi for Track
[src]
type Abi = u32
Same as RefFromWasmAbi::Abi
type Anchor = RefMut<'static, Track>
Same as RefFromWasmAbi::Anchor
unsafe fn ref_mut_from_abi(js: Self::Abi) -> Self::Anchor
[src]
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ReturnWasmAbi for T where
T: IntoWasmAbi,
[src]
T: IntoWasmAbi,
type Abi = <T as IntoWasmAbi>::Abi
Same as IntoWasmAbi::Abi
pub fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.