[WIP] Bug 1244768 part 2 - modify media element load algorith; r?jwwang draft
authorKaku Kuo <tkuo@mozilla.com>
Fri, 05 Aug 2016 15:44:03 +0800
changeset 398484 04cd914a650a0d681501ea5aa5fa18052dd21052
parent 398483 08d8704b21ff8104a78492dfab2b856981865fac
child 398485 568870e6f03d594ef48295e4617944a5dcb7949a
push id25539
push usertkuo@mozilla.com
push dateTue, 09 Aug 2016 07:08:46 +0000
reviewersjwwang
bugs1244768
milestone51.0a1
[WIP] Bug 1244768 part 2 - modify media element load algorith; r?jwwang 4.8.12.5 https://html.spec.whatwg.org/multipage/embedded-content.html#media-element-load-algorithim The living WHATWG spec has been changed since I implemented this patch. Will update to the latest spec later. MozReview-Commit-ID: 7U1AC2Ua83Z
dom/html/HTMLMediaElement.cpp
--- a/dom/html/HTMLMediaElement.cpp
+++ b/dom/html/HTMLMediaElement.cpp
@@ -1190,16 +1190,17 @@ void HTMLMediaElement::DoLoad()
   // view" of a gallery of videos.
   if (EventStateManager::IsHandlingUserInput() ||
       nsContentUtils::LegacyIsCallerChromeOrNativeCode()) {
     mHasUserInteraction = true;
   }
 
   SetPlayedOrSeeked(false);
   mIsRunningLoadMethod = true;
+  RejectPendingPlayPromises(TakePendingPlayPromises(), NS_ERROR_DOM_MEDIA_ABORT_ERR);
   AbortExistingLoads();
   SetPlaybackRate(mDefaultPlaybackRate);
   QueueSelectResourceTask();
   ResetState();
   mIsRunningLoadMethod = false;
 }
 
 void HTMLMediaElement::ResetState()