use dom_struct::dom_struct;
use crate::dom::bindings::codegen::Bindings::MediaErrorBinding::MediaErrorMethods;
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
use crate::dom::bindings::root::DomRoot;
use crate::dom::bindings::str::DOMString;
use crate::dom::window::Window;
#[dom_struct]
pub struct MediaError {
reflector_: Reflector,
code: u16,
}
impl MediaError {
fn new_inherited(code: u16) -> MediaError {
MediaError {
reflector_: Reflector::new(),
code,
}
}
pub fn new(window: &Window, code: u16) -> DomRoot<MediaError> {
reflect_dom_object(Box::new(MediaError::new_inherited(code)), window)
}
}
impl MediaErrorMethods for MediaError {
fn Code(&self) -> u16 {
self.code
}
fn Message(&self) -> DOMString {
DOMString::new()
}
}