Skip to content

Commit

Permalink
Signal EOS if media request fails
Browse files Browse the repository at this point in the history
  • Loading branch information
ferjm committed Dec 12, 2018
1 parent 243b4e1 commit 707b490
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions components/script/dom/htmlmediaelement.rs
Expand Up @@ -1614,12 +1614,16 @@ impl FetchResponseListener for HTMLMediaElementContext {

// https://html.spec.whatwg.org/multipage/#media-data-processing-steps-list
fn process_response_eof(&mut self, status: Result<ResourceFetchTiming, NetworkError>) {
let elem = self.elem.root();
if self.ignore_response {
// An error was received previously, skip processing the payload.
// An error was received previously, skip processing the payload
// and notify the media backend that we are done pushing data.
if let Err(e) = elem.player.end_of_stream() {
warn!("Could not signal EOS to player {:?}", e);
}
return;
}

let elem = self.elem.root();
if status.is_ok() {
if elem.ready_state.get() == ReadyState::HaveNothing {
// Make sure that we don't skip the HaveMetadata and HaveCurrentData
Expand Down

0 comments on commit 707b490

Please sign in to comment.