Chromium Code Reviews| 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; |