Struct web_sys::HtmlMediaElement
source · #[repr(transparent)]pub struct HtmlMediaElement { /* private fields */ }
Expand description
The HTMLMediaElement
object
This API requires the following crate features to be activated: HtmlMediaElement
Implementations§
source§impl HtmlMediaElement
impl HtmlMediaElement
sourcepub fn add_text_track(&self, kind: TextTrackKind) -> TextTrack
pub fn add_text_track(&self, kind: TextTrackKind) -> TextTrack
The addTextTrack()
method
This API requires the following crate features to be activated: HtmlMediaElement
, TextTrack
, TextTrackKind
source§impl HtmlMediaElement
impl HtmlMediaElement
sourcepub fn add_text_track_with_label(
&self,
kind: TextTrackKind,
label: &str
) -> TextTrack
pub fn add_text_track_with_label(
&self,
kind: TextTrackKind,
label: &str
) -> TextTrack
The addTextTrack()
method
This API requires the following crate features to be activated: HtmlMediaElement
, TextTrack
, TextTrackKind
source§impl HtmlMediaElement
impl HtmlMediaElement
sourcepub fn add_text_track_with_label_and_language(
&self,
kind: TextTrackKind,
label: &str,
language: &str
) -> TextTrack
pub fn add_text_track_with_label_and_language(
&self,
kind: TextTrackKind,
label: &str,
language: &str
) -> TextTrack
The addTextTrack()
method
This API requires the following crate features to be activated: HtmlMediaElement
, TextTrack
, TextTrackKind
source§impl HtmlMediaElement
impl HtmlMediaElement
sourcepub fn can_play_type(&self, type_: &str) -> String
pub fn can_play_type(&self, type_: &str) -> String
The canPlayType()
method
This API requires the following crate features to be activated: HtmlMediaElement
source§impl HtmlMediaElement
impl HtmlMediaElement
sourcepub fn has_suspend_taint(&self) -> bool
pub fn has_suspend_taint(&self) -> bool
The hasSuspendTaint()
method
This API requires the following crate features to be activated: HtmlMediaElement
source§impl HtmlMediaElement
impl HtmlMediaElement
source§impl HtmlMediaElement
impl HtmlMediaElement
sourcepub fn seek_to_next_frame(&self) -> Result<Promise, JsValue>
pub fn seek_to_next_frame(&self) -> Result<Promise, JsValue>
The seekToNextFrame()
method
This API requires the following crate features to be activated: HtmlMediaElement
source§impl HtmlMediaElement
impl HtmlMediaElement
sourcepub fn set_media_keys(&self, media_keys: Option<&MediaKeys>) -> Promise
pub fn set_media_keys(&self, media_keys: Option<&MediaKeys>) -> Promise
The setMediaKeys()
method
This API requires the following crate features to be activated: HtmlMediaElement
, MediaKeys
source§impl HtmlMediaElement
impl HtmlMediaElement
sourcepub fn set_visible(&self, a_visible: bool)
pub fn set_visible(&self, a_visible: bool)
The setVisible()
method
This API requires the following crate features to be activated: HtmlMediaElement
source§impl HtmlMediaElement
impl HtmlMediaElement
sourcepub fn error(&self) -> Option<MediaError>
pub fn error(&self) -> Option<MediaError>
The error
getter
This API requires the following crate features to be activated: HtmlMediaElement
, MediaError
source§impl HtmlMediaElement
impl HtmlMediaElement
source§impl HtmlMediaElement
impl HtmlMediaElement
source§impl HtmlMediaElement
impl HtmlMediaElement
sourcepub fn current_src(&self) -> String
pub fn current_src(&self) -> String
The currentSrc
getter
This API requires the following crate features to be activated: HtmlMediaElement
source§impl HtmlMediaElement
impl HtmlMediaElement
sourcepub fn cross_origin(&self) -> Option<String>
pub fn cross_origin(&self) -> Option<String>
The crossOrigin
getter
This API requires the following crate features to be activated: HtmlMediaElement
source§impl HtmlMediaElement
impl HtmlMediaElement
sourcepub fn set_cross_origin(&self, cross_origin: Option<&str>)
pub fn set_cross_origin(&self, cross_origin: Option<&str>)
The crossOrigin
setter
This API requires the following crate features to be activated: HtmlMediaElement
source§impl HtmlMediaElement
impl HtmlMediaElement
sourcepub fn network_state(&self) -> u16
pub fn network_state(&self) -> u16
The networkState
getter
This API requires the following crate features to be activated: HtmlMediaElement
source§impl HtmlMediaElement
impl HtmlMediaElement
source§impl HtmlMediaElement
impl HtmlMediaElement
sourcepub fn set_preload(&self, preload: &str)
pub fn set_preload(&self, preload: &str)
The preload
setter
This API requires the following crate features to be activated: HtmlMediaElement
source§impl HtmlMediaElement
impl HtmlMediaElement
sourcepub fn buffered(&self) -> TimeRanges
pub fn buffered(&self) -> TimeRanges
The buffered
getter
This API requires the following crate features to be activated: HtmlMediaElement
, TimeRanges
source§impl HtmlMediaElement
impl HtmlMediaElement
sourcepub fn ready_state(&self) -> u16
pub fn ready_state(&self) -> u16
The readyState
getter
This API requires the following crate features to be activated: HtmlMediaElement
source§impl HtmlMediaElement
impl HtmlMediaElement
source§impl HtmlMediaElement
impl HtmlMediaElement
sourcepub fn current_time(&self) -> f64
pub fn current_time(&self) -> f64
The currentTime
getter
This API requires the following crate features to be activated: HtmlMediaElement
source§impl HtmlMediaElement
impl HtmlMediaElement
sourcepub fn set_current_time(&self, current_time: f64)
pub fn set_current_time(&self, current_time: f64)
The currentTime
setter
This API requires the following crate features to be activated: HtmlMediaElement
source§impl HtmlMediaElement
impl HtmlMediaElement
source§impl HtmlMediaElement
impl HtmlMediaElement
source§impl HtmlMediaElement
impl HtmlMediaElement
sourcepub fn default_playback_rate(&self) -> f64
pub fn default_playback_rate(&self) -> f64
The defaultPlaybackRate
getter
This API requires the following crate features to be activated: HtmlMediaElement
source§impl HtmlMediaElement
impl HtmlMediaElement
sourcepub fn set_default_playback_rate(&self, default_playback_rate: f64)
pub fn set_default_playback_rate(&self, default_playback_rate: f64)
The defaultPlaybackRate
setter
This API requires the following crate features to be activated: HtmlMediaElement
source§impl HtmlMediaElement
impl HtmlMediaElement
sourcepub fn playback_rate(&self) -> f64
pub fn playback_rate(&self) -> f64
The playbackRate
getter
This API requires the following crate features to be activated: HtmlMediaElement
source§impl HtmlMediaElement
impl HtmlMediaElement
sourcepub fn set_playback_rate(&self, playback_rate: f64)
pub fn set_playback_rate(&self, playback_rate: f64)
The playbackRate
setter
This API requires the following crate features to be activated: HtmlMediaElement
source§impl HtmlMediaElement
impl HtmlMediaElement
sourcepub fn played(&self) -> TimeRanges
pub fn played(&self) -> TimeRanges
The played
getter
This API requires the following crate features to be activated: HtmlMediaElement
, TimeRanges
source§impl HtmlMediaElement
impl HtmlMediaElement
sourcepub fn seekable(&self) -> TimeRanges
pub fn seekable(&self) -> TimeRanges
The seekable
getter
This API requires the following crate features to be activated: HtmlMediaElement
, TimeRanges
source§impl HtmlMediaElement
impl HtmlMediaElement
source§impl HtmlMediaElement
impl HtmlMediaElement
source§impl HtmlMediaElement
impl HtmlMediaElement
sourcepub fn set_autoplay(&self, autoplay: bool)
pub fn set_autoplay(&self, autoplay: bool)
The autoplay
setter
This API requires the following crate features to be activated: HtmlMediaElement
source§impl HtmlMediaElement
impl HtmlMediaElement
source§impl HtmlMediaElement
impl HtmlMediaElement
source§impl HtmlMediaElement
impl HtmlMediaElement
source§impl HtmlMediaElement
impl HtmlMediaElement
sourcepub fn set_controls(&self, controls: bool)
pub fn set_controls(&self, controls: bool)
The controls
setter
This API requires the following crate features to be activated: HtmlMediaElement
source§impl HtmlMediaElement
impl HtmlMediaElement
source§impl HtmlMediaElement
impl HtmlMediaElement
sourcepub fn set_volume(&self, volume: f64)
pub fn set_volume(&self, volume: f64)
The volume
setter
This API requires the following crate features to be activated: HtmlMediaElement
source§impl HtmlMediaElement
impl HtmlMediaElement
source§impl HtmlMediaElement
impl HtmlMediaElement
source§impl HtmlMediaElement
impl HtmlMediaElement
sourcepub fn default_muted(&self) -> bool
pub fn default_muted(&self) -> bool
The defaultMuted
getter
This API requires the following crate features to be activated: HtmlMediaElement
source§impl HtmlMediaElement
impl HtmlMediaElement
sourcepub fn set_default_muted(&self, default_muted: bool)
pub fn set_default_muted(&self, default_muted: bool)
The defaultMuted
setter
This API requires the following crate features to be activated: HtmlMediaElement
source§impl HtmlMediaElement
impl HtmlMediaElement
sourcepub fn audio_tracks(&self) -> AudioTrackList
pub fn audio_tracks(&self) -> AudioTrackList
The audioTracks
getter
This API requires the following crate features to be activated: AudioTrackList
, HtmlMediaElement
source§impl HtmlMediaElement
impl HtmlMediaElement
sourcepub fn video_tracks(&self) -> VideoTrackList
pub fn video_tracks(&self) -> VideoTrackList
The videoTracks
getter
This API requires the following crate features to be activated: HtmlMediaElement
, VideoTrackList
source§impl HtmlMediaElement
impl HtmlMediaElement
sourcepub fn text_tracks(&self) -> Option<TextTrackList>
pub fn text_tracks(&self) -> Option<TextTrackList>
The textTracks
getter
This API requires the following crate features to be activated: HtmlMediaElement
, TextTrackList
source§impl HtmlMediaElement
impl HtmlMediaElement
sourcepub fn media_keys(&self) -> Option<MediaKeys>
pub fn media_keys(&self) -> Option<MediaKeys>
The mediaKeys
getter
This API requires the following crate features to be activated: HtmlMediaElement
, MediaKeys
source§impl HtmlMediaElement
impl HtmlMediaElement
sourcepub fn onencrypted(&self) -> Option<Function>
pub fn onencrypted(&self) -> Option<Function>
The onencrypted
getter
This API requires the following crate features to be activated: HtmlMediaElement
source§impl HtmlMediaElement
impl HtmlMediaElement
sourcepub fn set_onencrypted(&self, onencrypted: Option<&Function>)
pub fn set_onencrypted(&self, onencrypted: Option<&Function>)
The onencrypted
setter
This API requires the following crate features to be activated: HtmlMediaElement
source§impl HtmlMediaElement
impl HtmlMediaElement
sourcepub fn onwaitingforkey(&self) -> Option<Function>
pub fn onwaitingforkey(&self) -> Option<Function>
The onwaitingforkey
getter
This API requires the following crate features to be activated: HtmlMediaElement
source§impl HtmlMediaElement
impl HtmlMediaElement
sourcepub fn set_onwaitingforkey(&self, onwaitingforkey: Option<&Function>)
pub fn set_onwaitingforkey(&self, onwaitingforkey: Option<&Function>)
The onwaitingforkey
setter
This API requires the following crate features to be activated: HtmlMediaElement
source§impl HtmlMediaElement
impl HtmlMediaElement
pub const NETWORK_EMPTY: u16 = 0u16
source§impl HtmlMediaElement
impl HtmlMediaElement
pub const NETWORK_IDLE: u16 = 1u16
source§impl HtmlMediaElement
impl HtmlMediaElement
pub const NETWORK_LOADING: u16 = 2u16
source§impl HtmlMediaElement
impl HtmlMediaElement
pub const NETWORK_NO_SOURCE: u16 = 3u16
source§impl HtmlMediaElement
impl HtmlMediaElement
pub const HAVE_NOTHING: u16 = 0u16
source§impl HtmlMediaElement
impl HtmlMediaElement
pub const HAVE_METADATA: u16 = 1u16
source§impl HtmlMediaElement
impl HtmlMediaElement
pub const HAVE_CURRENT_DATA: u16 = 2u16
source§impl HtmlMediaElement
impl HtmlMediaElement
pub const HAVE_FUTURE_DATA: u16 = 3u16
source§impl HtmlMediaElement
impl HtmlMediaElement
pub const HAVE_ENOUGH_DATA: u16 = 4u16
Trait Implementations§
source§impl AsRef<Element> for HtmlMediaElement
impl AsRef<Element> for HtmlMediaElement
source§impl AsRef<EventTarget> for HtmlMediaElement
impl AsRef<EventTarget> for HtmlMediaElement
source§fn as_ref(&self) -> &EventTarget
fn as_ref(&self) -> &EventTarget
source§impl AsRef<HtmlElement> for HtmlMediaElement
impl AsRef<HtmlElement> for HtmlMediaElement
source§fn as_ref(&self) -> &HtmlElement
fn as_ref(&self) -> &HtmlElement
source§impl AsRef<HtmlMediaElement> for HtmlAudioElement
impl AsRef<HtmlMediaElement> for HtmlAudioElement
source§fn as_ref(&self) -> &HtmlMediaElement
fn as_ref(&self) -> &HtmlMediaElement
source§impl AsRef<HtmlMediaElement> for HtmlVideoElement
impl AsRef<HtmlMediaElement> for HtmlVideoElement
source§fn as_ref(&self) -> &HtmlMediaElement
fn as_ref(&self) -> &HtmlMediaElement
source§impl AsRef<JsValue> for HtmlMediaElement
impl AsRef<JsValue> for HtmlMediaElement
source§impl AsRef<Node> for HtmlMediaElement
impl AsRef<Node> for HtmlMediaElement
source§impl AsRef<Object> for HtmlMediaElement
impl AsRef<Object> for HtmlMediaElement
source§impl Clone for HtmlMediaElement
impl Clone for HtmlMediaElement
source§fn clone(&self) -> HtmlMediaElement
fn clone(&self) -> HtmlMediaElement
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for HtmlMediaElement
impl Debug for HtmlMediaElement
source§impl From<HtmlAudioElement> for HtmlMediaElement
impl From<HtmlAudioElement> for HtmlMediaElement
source§fn from(obj: HtmlAudioElement) -> HtmlMediaElement
fn from(obj: HtmlAudioElement) -> HtmlMediaElement
source§impl From<HtmlMediaElement> for Element
impl From<HtmlMediaElement> for Element
source§fn from(obj: HtmlMediaElement) -> Element
fn from(obj: HtmlMediaElement) -> Element
source§impl From<HtmlMediaElement> for EventTarget
impl From<HtmlMediaElement> for EventTarget
source§fn from(obj: HtmlMediaElement) -> EventTarget
fn from(obj: HtmlMediaElement) -> EventTarget
source§impl From<HtmlMediaElement> for HtmlElement
impl From<HtmlMediaElement> for HtmlElement
source§fn from(obj: HtmlMediaElement) -> HtmlElement
fn from(obj: HtmlMediaElement) -> HtmlElement
source§impl From<HtmlMediaElement> for JsValue
impl From<HtmlMediaElement> for JsValue
source§fn from(obj: HtmlMediaElement) -> JsValue
fn from(obj: HtmlMediaElement) -> JsValue
source§impl From<HtmlMediaElement> for Node
impl From<HtmlMediaElement> for Node
source§fn from(obj: HtmlMediaElement) -> Node
fn from(obj: HtmlMediaElement) -> Node
source§impl From<HtmlMediaElement> for Object
impl From<HtmlMediaElement> for Object
source§fn from(obj: HtmlMediaElement) -> Object
fn from(obj: HtmlMediaElement) -> Object
source§impl From<HtmlVideoElement> for HtmlMediaElement
impl From<HtmlVideoElement> for HtmlMediaElement
source§fn from(obj: HtmlVideoElement) -> HtmlMediaElement
fn from(obj: HtmlVideoElement) -> HtmlMediaElement
source§impl From<JsValue> for HtmlMediaElement
impl From<JsValue> for HtmlMediaElement
source§fn from(obj: JsValue) -> HtmlMediaElement
fn from(obj: JsValue) -> HtmlMediaElement
source§impl FromWasmAbi for HtmlMediaElement
impl FromWasmAbi for HtmlMediaElement
source§impl<'a> IntoWasmAbi for &'a HtmlMediaElement
impl<'a> IntoWasmAbi for &'a HtmlMediaElement
source§impl IntoWasmAbi for HtmlMediaElement
impl IntoWasmAbi for HtmlMediaElement
source§impl JsCast for HtmlMediaElement
impl JsCast for HtmlMediaElement
source§fn instanceof(val: &JsValue) -> bool
fn instanceof(val: &JsValue) -> bool
instanceof
check to see whether the JsValue
provided is an instance of this type. Read moresource§fn unchecked_from_js(val: JsValue) -> Self
fn unchecked_from_js(val: JsValue) -> Self
source§fn unchecked_from_js_ref(val: &JsValue) -> &Self
fn unchecked_from_js_ref(val: &JsValue) -> &Self
source§fn is_instance_of<T>(&self) -> boolwhere
T: JsCast,
fn is_instance_of<T>(&self) -> boolwhere
T: JsCast,
T
. Read moresource§fn dyn_into<T>(self) -> Result<T, Self>where
T: JsCast,
fn dyn_into<T>(self) -> Result<T, Self>where
T: JsCast,
T
. Read moresource§fn dyn_ref<T>(&self) -> Option<&T>where
T: JsCast,
fn dyn_ref<T>(&self) -> Option<&T>where
T: JsCast,
T
. Read moresource§fn unchecked_into<T>(self) -> Twhere
T: JsCast,
fn unchecked_into<T>(self) -> Twhere
T: JsCast,
source§impl OptionFromWasmAbi for HtmlMediaElement
impl OptionFromWasmAbi for HtmlMediaElement
source§impl<'a> OptionIntoWasmAbi for &'a HtmlMediaElement
impl<'a> OptionIntoWasmAbi for &'a HtmlMediaElement
source§impl OptionIntoWasmAbi for HtmlMediaElement
impl OptionIntoWasmAbi for HtmlMediaElement
source§impl RefFromWasmAbi for HtmlMediaElement
impl RefFromWasmAbi for HtmlMediaElement
§type Abi = <JsValue as RefFromWasmAbi>::Abi
type Abi = <JsValue as RefFromWasmAbi>::Abi
Self
are recovered from.§type Anchor = ManuallyDrop<HtmlMediaElement>
type Anchor = ManuallyDrop<HtmlMediaElement>
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 moreAuto Trait Implementations§
impl RefUnwindSafe for HtmlMediaElement
impl Send for HtmlMediaElement
impl Sync for HtmlMediaElement
impl Unpin for HtmlMediaElement
impl UnwindSafe for HtmlMediaElement
Blanket Implementations§
source§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
IntoWasmAbi::Abi
source§fn return_abi(self, extra: &mut dyn Stack) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self, extra: &mut dyn Stack) -> <T as ReturnWasmAbi>::Abi
IntoWasmAbi::into_abi
, except that it may throw and never
return in the case of Err
. Read more