Bug 1194197: [MSE] Properly propagate decoding and network errors to media element. r=cpearce a=ritu
authorJean-Yves Avenard <jyavenard@mozilla.com>
Fri, 14 Aug 2015 12:02:57 +1000
changeset 277500 a5843169a5497397091a719e0d70eb3d126f0572
parent 277499 e16abdb5bb0118fa30a5cdfe56b012d5cfbdd64f
child 277501 a9d79eb7e02a26455ac844870fd0128c3446d922
push id8377
push userrgiles@mozilla.com
push dateFri, 04 Sep 2015 04:14:59 +0000
treeherdermozilla-aurora@a9d79eb7e02a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce, ritu
bugs1194197
milestone42.0a2
Bug 1194197: [MSE] Properly propagate decoding and network errors to media element. r=cpearce a=ritu 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)