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

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

Issue 2710713003: Media Controls: Remove download button for infinite streams (Closed)
Patch Set: Created 3 years, 10 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
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 bb6da9e90b6f07dac88e6b7814d3c747a9f3e176..567a7a7586c5d42f09d9217ab8a3fbba13960162 100644
--- a/third_party/WebKit/Source/core/html/shadow/MediaControlElements.cpp
+++ b/third_party/WebKit/Source/core/html/shadow/MediaControlElements.cpp
@@ -679,7 +679,7 @@ bool MediaControlDownloadButtonElement::shouldDisplayDownloadButton() {
if (url.isNull() || url.isEmpty())
return false;
- // Local files and blobs should not have a download button.
+ // Local files and blobs (including MSE) should not have a download button.
if (url.isLocalFile() || url.protocolIs("blob"))
return false;
@@ -695,6 +695,11 @@ bool MediaControlDownloadButtonElement::shouldDisplayDownloadButton() {
if (HTMLMediaElement::isHLSURL(url))
return false;
+ // Infinite streams don't have a clear end at which to finish the download
+ // (would require adding UI to prompt for the duration to download).
+ if (mediaElement().duration() == std::numeric_limits<double>::infinity())
+ return false;
+
return true;
}

Powered by Google App Engine
This is Rietveld 408576698