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

Unified Diff: third_party/WebKit/Source/core/html/HTMLMediaElement.cpp

Issue 2075563003: [Android, Media] Don't unlock MediaStream elements; instead allow MS to autoplay without a gesture. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Whitespace changes Created 4 years, 6 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 | « third_party/WebKit/LayoutTests/media/autoplay-from-mediastream-to-src.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
index bff62e7bfdb250473405fbd5bc2215a8d99b8bf2..0af541c17e923d2be94add6c7200fd8b2d37c148 100644
--- a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
@@ -1034,9 +1034,7 @@ void HTMLMediaElement::loadResource(const WebMediaPlayerSource& source, const Co
bool isStreamOrBlobUrl = source.isMediaStream() || url.protocolIs(mediaSourceBlobProtocol);
if (isStreamOrBlobUrl) {
sof 2016/06/27 15:10:47 The logic looks a bit strange now - more readable
whywhat 2016/06/27 15:35:58 Ok, I guess the overall condition triggering the c
sof 2016/06/27 18:54:06 That makes it a lot clearer, i.e., check if a medi
whywhat 2016/06/27 19:00:50 Not sure if it became much more clearer but I took
bool isMediaStream = source.isMediaStream() || (source.isURL() && isMediaStreamURL(url.getString()));
- if (isMediaStream) {
- m_autoplayHelper->unlockUserGesture(GesturelessPlaybackEnabledByStream);
- } else {
+ if (!isMediaStream) {
m_mediaSource = HTMLMediaSource::lookup(url.getString());
if (m_mediaSource) {
@@ -1223,7 +1221,7 @@ WebMediaPlayer::LoadType HTMLMediaElement::loadType() const
if (m_mediaSource)
return WebMediaPlayer::LoadTypeMediaSource;
- if (m_srcObject || isMediaStreamURL(m_currentSrc.getString()))
+ if (m_srcObject || (!m_currentSrc.isNull() && isMediaStreamURL(m_currentSrc.getString())))
return WebMediaPlayer::LoadTypeMediaStream;
return WebMediaPlayer::LoadTypeURL;
@@ -3725,6 +3723,9 @@ bool HTMLMediaElement::isGestureNeededForPlayback() const
if (!m_lockedPendingUserGesture)
return false;
+ if (loadType() == WebMediaPlayer::LoadTypeMediaStream)
+ return false;
+
// We want to allow muted video to autoplay if:
// - the flag is enabled;
// - Data Saver is not enabled;
« no previous file with comments | « third_party/WebKit/LayoutTests/media/autoplay-from-mediastream-to-src.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698