Bug 1244768 part 3 - modify the resource selection algorithm; r=jwwang
authorKaku Kuo <tkuo@mozilla.com>
Thu, 18 Aug 2016 20:04:27 +0800
changeset 325497 b8c156c5cff840f28e995caa5c0f5bce9a121fcc
parent 325496 2a13aa8e9a76aeb83c8a342487b856d0b7857ed0
child 325498 fafd16dfeac96ca44c5f704f049e23d40fabd591
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
reviewersjwwang
bugs1244768
milestone53.0a1
Bug 1244768 part 3 - modify the resource selection algorithm; r=jwwang 4.8.12.5 https://html.spec.whatwg.org/multipage/embedded-content.html#concept-media-load-algorithm https://html.spec.whatwg.org/multipage/embedded-content.html#dedicated-media-source-failure-steps MozReview-Commit-ID: DKFQC4v92Vi
dom/html/HTMLMediaElement.cpp
dom/html/HTMLMediaElement.h
--- a/dom/html/HTMLMediaElement.cpp
+++ b/dom/html/HTMLMediaElement.cpp
@@ -1690,16 +1690,17 @@ void HTMLMediaElement::AbortExistingLoad
 void HTMLMediaElement::NoSupportedMediaSourceError(const nsACString& aErrorDetails)
 {
   if (mDecoder) {
     ShutdownDecoder();
   }
   mErrorSink->SetError(MEDIA_ERR_SRC_NOT_SUPPORTED, aErrorDetails);
   ChangeDelayLoadStatus(false);
   UpdateAudioChannelPlayingState();
+  RejectPromises(TakePendingPlayPromises(), NS_ERROR_DOM_MEDIA_NOT_SUPPORTED_ERR);
 }
 
 typedef void (HTMLMediaElement::*SyncSectionFn)();
 
 // Runs a "synchronous section", a function that must run once the event loop
 // has reached a "stable state". See:
 // http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#synchronous-section
 class nsSyncSection : public nsMediaEvent
--- a/dom/html/HTMLMediaElement.h
+++ b/dom/html/HTMLMediaElement.h
@@ -951,16 +951,17 @@ protected:
   /**
    * Execute the initial steps of the load algorithm that ensure existing
    * loads are aborted, the element is emptied, and a new load ID is
    * created.
    */
   void AbortExistingLoads();
 
   /**
+   * This is the dedicated media source failure steps.
    * Called when all potential resources are exhausted. Changes network
    * state to NETWORK_NO_SOURCE, and sends error event with code
    * MEDIA_ERR_SRC_NOT_SUPPORTED.
    */
   void NoSupportedMediaSourceError(const nsACString& aErrorDetails = nsCString());
 
   /**
    * Attempts to load resources from the <source> children. This is a