web-audio-api-rs icon indicating copy to clipboard operation
web-audio-api-rs copied to clipboard

MediaRecorder spec compliance: add options and isTypeSupported

Open orottier opened this issue 1 year ago • 0 comments

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;

orottier avatar May 07 '24 05:05 orottier