Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(58)

Unified Diff: third_party/WebKit/Source/core/html/shadow/MediaControlElements.cpp

Issue 1827573004: Allow play/pause on default controls to clear media errors. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Disable MediaSource and MediaStream URLs. Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/shadow/MediaControls.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/html/shadow/MediaControlElements.cpp
diff --git a/third_party/WebKit/Source/core/html/shadow/MediaControlElements.cpp b/third_party/WebKit/Source/core/html/shadow/MediaControlElements.cpp
index 36ef45117fe63fa5a41b48feb7d9b07465783d47..e76fa538b58fbedf92501b749bc467c85e41b308 100644
--- a/third_party/WebKit/Source/core/html/shadow/MediaControlElements.cpp
+++ b/third_party/WebKit/Source/core/html/shadow/MediaControlElements.cpp
@@ -35,6 +35,7 @@
#include "core/dom/shadow/ShadowRoot.h"
#include "core/events/MouseEvent.h"
#include "core/frame/LocalFrame.h"
+#include "core/html/HTMLMediaSource.h"
#include "core/html/HTMLVideoElement.h"
#include "core/html/TimeRanges.h"
#include "core/html/shadow/MediaControls.h"
@@ -284,6 +285,12 @@ PassRefPtrWillBeRawPtr<MediaControlPlayButtonElement> MediaControlPlayButtonElem
void MediaControlPlayButtonElement::defaultEventHandler(Event* event)
{
if (event->type() == EventTypeNames::click) {
+ // Allow play attempts for plain src= media to force a reload in the error state. This allows potential
+ // recovery for transient network and decoder resource issues.
+ const String& url = mediaElement().currentSrc().getString();
+ if (mediaElement().error() && !HTMLMediaElement::isMediaStreamURL(url) && !HTMLMediaSource::lookup(url))
wolenetz 2016/03/24 23:05:04 A web app could have explicitly revoked the MediaS
philipj_slow 2016/03/29 13:24:15 Maybe just gate this on KURL::protocolIsInHTTPFami
DaleCurtis 2016/03/29 21:41:14 Depending on the failure type data/blob URLs may h
+ mediaElement().load();
+
mediaElement().togglePlayState();
updateDisplayType();
event->setDefaultHandled();
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/shadow/MediaControls.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698