Bug 1244768 part 3 - modify the resource selection algorithm; r?jwwang draft
authorKaku Kuo <tkuo@mozilla.com>
Thu, 18 Aug 2016 20:04:27 +0800
changeset 448112 373f3e463d384cce242b575e36f90011264564a7
parent 448111 2d31235d06070888f271cdd37f7ad60d03dfc531
child 448113 24638d36969733e0c6dc75a86db229c845320bb1
push id38268
push userbmo:kaku@mozilla.com
push dateFri, 09 Dec 2016 07:03:42 +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