web-audio-api-rs
web-audio-api-rs copied to clipboard
MediaRecorder spec compliance: add options and isTypeSupported
To future proof the v1 API we should change the constructor from
pub fn new(stream: &MediaStream) -> MediaRecorder
to
pub fn new(stream: &MediaStream, options: MediaRecorderOptions) -> Result<MediaRecorder, DomException>
with
#[non_exhaustive]
#[derive(Debug, Clone, Default)]
pub struct DomException {
pub name: String,
pub message: String,
}
#[non_exhaustive]
#[derive(Debug, Clone, Default)]
pub struct MediaRecorderOptions {
pub mime_type: String, // use "" as default
}
fn is_type_supported(mime_type: String) -> bool;