Remove gecko-media dependency

This commit is contained in:
Fernando Jiménez Moreno 2018-01-18 14:20:54 +01:00
parent 671b69c0b7
commit f46fbe4599
12 changed files with 72 additions and 252 deletions

View file

@ -31,13 +31,10 @@ use dom::node::{window_from_node, document_from_node, Node, UnbindContext};
use dom::promise::Promise;
use dom::virtualmethods::VirtualMethods;
use dom_struct::dom_struct;
#[cfg(all(any(target_os = "macos", target_os = "linux"), not(any(target_arch = "arm", target_arch = "aarch64"))))]
use gecko_media::{CanPlayType, GeckoMedia};
use html5ever::{LocalName, Prefix};
use ipc_channel::ipc;
use ipc_channel::router::ROUTER;
use microtask::{Microtask, MicrotaskRunnable};
#[allow(unused_imports)]
use mime::{Mime, SubLevel, TopLevel};
use net_traits::{FetchResponseListener, FetchMetadata, Metadata, NetworkError};
use net_traits::request::{CredentialsMode, Destination, RequestInit};
@ -870,27 +867,6 @@ impl HTMLMediaElementMethods for HTMLMediaElement {
self.media_element_load_algorithm();
}
#[cfg(all(
any(target_os = "macos", target_os = "linux"),
not(any(target_arch = "arm", target_arch = "aarch64")),
))]
// https://html.spec.whatwg.org/multipage/#dom-navigator-canplaytype
fn CanPlayType(&self, type_: DOMString) -> CanPlayTypeResult {
let gecko_media = match GeckoMedia::get() {
Ok(gecko_media) => gecko_media,
Err(_) => return CanPlayTypeResult::_empty,
};
match gecko_media.can_play_type(&type_) {
CanPlayType::No => CanPlayTypeResult::_empty,
CanPlayType::Maybe => CanPlayTypeResult::Maybe,
CanPlayType::Probably => CanPlayTypeResult::Probably
}
}
#[cfg(not(all(
any(target_os = "macos", target_os = "linux"),
not(any(target_arch = "arm", target_arch = "aarch64")),
)))]
// https://html.spec.whatwg.org/multipage/#dom-navigator-canplaytype
fn CanPlayType(&self, type_: DOMString) -> CanPlayTypeResult {
match type_.parse::<Mime>() {