Struct web_audio_api::MediaElement
source · pub struct MediaElement { /* private fields */ }
Expand description
Shim of the <audio>
element which allows you to efficiently play and seek audio from disk
The documentation for MediaElementAudioSourceNode
contains usage instructions.
Implementations§
source§impl MediaElement
impl MediaElement
sourcepub fn new<P: Into<PathBuf>>(file: P) -> Result<Self, Box<dyn Error>>
pub fn new<P: Into<PathBuf>>(file: P) -> Result<Self, Box<dyn Error>>
Create a new instance for a given file path
pub fn current_time(&self) -> f64
pub fn set_current_time(&self, value: f64)
pub fn loop_(&self) -> bool
pub fn set_loop(&self, value: bool)
pub fn play(&self)
pub fn pause(&self)
pub fn paused(&self) -> bool
pub fn playback_rate(&self) -> f64
pub fn set_playback_rate(&self, value: f64)
Auto Trait Implementations§
impl !RefUnwindSafe for MediaElement
impl Send for MediaElement
impl !Sync for MediaElement
impl Unpin for MediaElement
impl !UnwindSafe for MediaElement
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more