RESOLVED FIXED 228008
Add support for MediaError.message
https://bugs.webkit.org/show_bug.cgi?id=228008
Summary Add support for MediaError.message
Chris Dumez
Reported 2021-07-15 16:11:52 PDT
Add support for MediaError.message: - https://html.spec.whatwg.org/multipage/media.html#mediaerror Both Chrome and Firefox already support this.
Attachments
Patch (9.97 KB, patch)
2021-07-15 16:18 PDT, Chris Dumez
no flags
Patch (9.92 KB, patch)
2021-07-15 17:39 PDT, Chris Dumez
no flags
Patch (12.02 KB, patch)
2021-07-15 22:24 PDT, Chris Dumez
no flags
Chris Dumez
Comment 1 2021-07-15 16:18:37 PDT
Alex Christensen
Comment 2 2021-07-15 17:26:15 PDT
Comment on attachment 433634 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=433634&action=review > Source/WebCore/html/HTMLMediaElement.cpp:2072 > + m_error = MediaError::create(MediaError::MEDIA_ERR_SRC_NOT_SUPPORTED, "Unsupported source type"_s); Do Chrome and Firefox use these same strings?
Alex Christensen
Comment 3 2021-07-15 17:27:20 PDT
Comment on attachment 433634 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=433634&action=review >> Source/WebCore/html/HTMLMediaElement.cpp:2072 >> + m_error = MediaError::create(MediaError::MEDIA_ERR_SRC_NOT_SUPPORTED, "Unsupported source type"_s); > > Do Chrome and Firefox use these same strings? Can these strings be derived from m_code instead of storing an additional String an increasing the size of MediaError?
Chris Dumez
Comment 4 2021-07-15 17:29:13 PDT
(In reply to Alex Christensen from comment #3) > Comment on attachment 433634 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=433634&action=review > > >> Source/WebCore/html/HTMLMediaElement.cpp:2072 > >> + m_error = MediaError::create(MediaError::MEDIA_ERR_SRC_NOT_SUPPORTED, "Unsupported source type"_s); > > > > Do Chrome and Firefox use these same strings? > > Can these strings be derived from m_code instead of storing an additional > String an increasing the size of MediaError? While I did the strict minimum in this patch, you could imagine providing more useful error messages in the future. What's the point of having a message attribute if it brings nothing more than the error code attribute?
Alex Christensen
Comment 5 2021-07-15 17:32:20 PDT
Comment on attachment 433634 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=433634&action=review > Source/WebCore/html/MediaError.h:46 > + static Ref<MediaError> create(Code code, const String& message) This could at least be an r-value then.
Chris Dumez
Comment 6 2021-07-15 17:32:42 PDT
(In reply to Alex Christensen from comment #5) > Comment on attachment 433634 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=433634&action=review > > > Source/WebCore/html/MediaError.h:46 > > + static Ref<MediaError> create(Code code, const String& message) > > This could at least be an r-value then. Sure.
Chris Dumez
Comment 7 2021-07-15 17:39:13 PDT
Chris Dumez
Comment 8 2021-07-15 22:24:48 PDT
EWS
Comment 9 2021-07-15 23:15:55 PDT
Committed r279978 (239721@main): <https://commits.webkit.org/239721@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 433658 [details].
Radar WebKit Bug Importer
Comment 10 2021-07-15 23:16:16 PDT
Ahmad Saleem
Comment 11 2022-09-03 05:03:18 PDT
*** Bug 170761 has been marked as a duplicate of this bug. ***
Note You need to log in before you can comment on or make changes to this bug.