Skip to content
  • wolenetz's avatar
    Add MediaError.message · ed8e7091
    wolenetz authored
    This improves the level of information available for web authors to use
    when debugging media playback errors.
    
    * Adds support for the MediaError.message field [1] [2]
    
    * Changes MediaLog::PipelineStatusToString() to return just a
      stringified version of the enum identifier, suitable for use as a
      UA-specific-code when included in MediaError.message.
    
    * Changes MediaLog::GetErrorMessage() to produce messages in the form:
      [[Stringified pipeline error code, if any, without any colon][: The
      first MEDIA_ERROR_LOG_ENTRY from the log, if any, since that is most
      likely to contain the most precise error information]]
      The produced message does not contain any newlines.
      See the updated media_browsertest.cc for basic examples.
    
    * When the message would otherwise be empty for various cases in
      HTMLMediaElement, and more meaningful information beyond the basic
      standard MediaError codes and HTMLMediaElement networkStates is
      available, reports basic additional information (prefixed by error
      code "MEDIA_ELEMENT_ERROR: ".) This should assist edge case
      differentiation. See the updated media_browsertest.cc for basic
      examples.
    
    * Test coverage:
      * Adds basic layout test coverage test similar to that added in [3].
      * Adds basic content browser test coverage for a small variety of
        errors, since these messages' format and content are specific to
        Chrom*.
    
    The format of the message string may change in future (for example, see
    discussion in [4]). Also, the variety of error codes in the message
    prior to the first ':' will likely change in future, and the descriptive
    error message detail following the ':' will likely change to include
    more cases or more consistent format in future.
    
    [1] - https://github.com/whatwg/html/issues/2085
    [2] - https://github.com/whatwg/html/pull/2086
    [3] - https://github.com/w3c/web-platform-tests/pull/4638
    [4] - https://github.com/whatwg/html/issues/2531
    [Intent to implement and ship] -
    https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/yDIyWozG1xk
    
    BUG=601086, 710617
    
    Review-Url: https://codereview.chromium.org/2660003003
    Cr-Commit-Position: refs/heads/master@{#466359}
    ed8e7091