Bug 1194197: [MSE] Properly propagate decoding and network errors to media element. r=cpearce a=ritu
☠☠ backed out by 5bb661db5c6c ☠ ☠
authorJean-Yves Avenard <jyavenard@mozilla.com>
Fri, 14 Aug 2015 12:02:57 +1000
changeset 277377 6c3044880eb142f186dc440fdfd3ac3568099871
parent 277376 1f8570570a4fb48c0f4c0880cf81a2132dd9b6e9
child 277378 89ec7fc554b9a7bd6d0543a5c7e8e15da2a0bfa2
push id8360
push userrgiles@mozilla.com
push dateFri, 28 Aug 2015 20:39:24 +0000
treeherdermozilla-aurora@e0eaf1f5b1d0 [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)