Skip to content

Commit

Permalink
Set input size
Browse files Browse the repository at this point in the history
  • Loading branch information
ferjm committed Oct 8, 2018
1 parent 50582f1 commit 5bbd097
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion components/script/dom/htmlmediaelement.rs
Expand Up @@ -33,6 +33,7 @@ use dom::virtualmethods::VirtualMethods;
use dom_struct::dom_struct;
use fetch::FetchCanceller;
use html5ever::{LocalName, Prefix};
use hyper::header::ContentLength;
use ipc_channel::ipc;
use ipc_channel::router::ROUTER;
use microtask::{Microtask, MicrotaskRunnable};
Expand Down Expand Up @@ -993,7 +994,6 @@ impl HTMLMediaElement {

// Step 5.
if self.is::<HTMLVideoElement>() {
assert_ne!(self.ready_state.get(), ReadyState::HaveNothing);
let video_elem = self.downcast::<HTMLVideoElement>().unwrap();
video_elem.set_video_width(metadata.width);
video_elem.set_video_height(metadata.height);
Expand Down Expand Up @@ -1235,6 +1235,14 @@ impl FetchResponseListener for HTMLMediaElementContext {
FetchMetadata::Filtered { unsafe_, .. } => unsafe_,
});

if let Some(metadata) = self.metadata.as_ref() {
if let Some(headers) = metadata.headers.as_ref() {
if let Some(content_length) = headers.get::<ContentLength>() {
self.elem.root().player.set_input_size(**content_length);
}
}
}

let status_is_ok = self
.metadata
.as_ref()
Expand Down

0 comments on commit 5bbd097

Please sign in to comment.