Bug 1287021: [MSE] Set delaying-the-load-event-flag to false when attaching media source. r?jwwang draft
authorJean-Yves Avenard <jyavenard@mozilla.com>
Fri, 15 Jul 2016 14:22:47 +1000
changeset 388382 69359820a2973f080a5ffa043cd23e5c0e1012ba
parent 387602 3e898eb963a6d1dd6f2e0cf430b77be736b51feb
child 388514 af280053152e7fb80f4b079432122f3e739efd55
push id23147
push userbmo:jyavenard@mozilla.com
push dateFri, 15 Jul 2016 15:16:56 +0000
reviewersjwwang
bugs1287021
milestone50.0a1
Bug 1287021: [MSE] Set delaying-the-load-event-flag to false when attaching media source. r?jwwang MozReview-Commit-ID: IsF1BPHrjce
dom/html/HTMLMediaElement.cpp
--- a/dom/html/HTMLMediaElement.cpp
+++ b/dom/html/HTMLMediaElement.cpp
@@ -1517,16 +1517,17 @@ nsresult HTMLMediaElement::LoadResource(
     RefPtr<MediaSourceDecoder> decoder = new MediaSourceDecoder(this);
     if (!mMediaSource->Attach(decoder)) {
       // TODO: Handle failure: run "If the media data cannot be fetched at
       // all, due to network errors, causing the user agent to give up
       // trying to fetch the resource" section of resource fetch algorithm.
       decoder->Shutdown();
       return NS_ERROR_FAILURE;
     }
+    ChangeDelayLoadStatus(false);
     RefPtr<MediaResource> resource =
       MediaSourceDecoder::CreateResource(mMediaSource->GetPrincipal());
     return FinishDecoderSetup(decoder, resource, nullptr);
   }
 
   RefPtr<ChannelLoader> loader = new ChannelLoader;
   nsresult rv = loader->Load(this);
   if (NS_SUCCEEDED(rv)) {