Bug 1194197: [MSE] Properly propagate decoding and network errors to media element. r=cpearce
authorJean-Yves Avenard <jyavenard@mozilla.com>
Fri, 14 Aug 2015 12:02:57 +1000
changeset 257774 c2a85adcd4c0ae4fdb29c4afd9f7f44a08825078
parent 257773 77aa950d8fbdacd540a9c8bf07df7c5f6a44067e
child 257775 54d0fc9946067a995cc49326fd3861303cd1f105
push id29226
push userryanvm@gmail.com
push dateFri, 14 Aug 2015 13:01:14 +0000
treeherdermozilla-central@1b2402247429 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce
bugs1194197
milestone43.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1194197: [MSE] Properly propagate decoding and network errors to media element. r=cpearce This is not 100% per spec, however neither is our handling of those errors in the media element.
dom/media/mediasource/MediaSource.cpp
--- a/dom/media/mediasource/MediaSource.cpp
+++ b/dom/media/mediasource/MediaSource.cpp
@@ -303,24 +303,20 @@ MediaSource::EndOfStream(const Optional<
       return;
     }
     // Notify reader that all data is now available.
     mDecoder->Ended(true);
     return;
   }
   switch (aError.Value()) {
   case MediaSourceEndOfStreamError::Network:
-    // TODO: If media element has a readyState of:
-    //   HAVE_NOTHING -> run resource fetch algorithm
-    // > HAVE_NOTHING -> run "interrupted" steps of resource fetch
+    mDecoder->NetworkError();
     break;
   case MediaSourceEndOfStreamError::Decode:
-    // TODO: If media element has a readyState of:
-    //   HAVE_NOTHING -> run "unsupported" steps of resource fetch
-    // > HAVE_NOTHING -> run "corrupted" steps of resource fetch
+    mDecoder->DecodeError();
     break;
   default:
     aRv.Throw(NS_ERROR_DOM_INVALID_ACCESS_ERR);
   }
 }
 
 /* static */ bool
 MediaSource::IsTypeSupported(const GlobalObject&, const nsAString& aType)