Chromium Code Reviews| Index: Source/core/html/HTMLMediaElement.cpp |
| diff --git a/Source/core/html/HTMLMediaElement.cpp b/Source/core/html/HTMLMediaElement.cpp |
| index f66f59c4422ba466b0ee4f8c44bcdb3692db78c2..ca5f073d20253e8a8c2617fe00db7cfcb3f5f66c 100644 |
| --- a/Source/core/html/HTMLMediaElement.cpp |
| +++ b/Source/core/html/HTMLMediaElement.cpp |
| @@ -59,6 +59,7 @@ |
| #include "core/html/track/TextTrackList.h" |
| #include "core/html/track/VideoTrack.h" |
| #include "core/html/track/VideoTrackList.h" |
| +#include "core/inspector/ConsoleMessage.h" |
| #include "core/layout/LayoutVideo.h" |
| #include "core/layout/LayoutView.h" |
| #include "core/layout/compositing/DeprecatedPaintLayerCompositor.h" |
| @@ -1914,8 +1915,16 @@ void HTMLMediaElement::play() |
| if (!UserGestureIndicator::processingUserGesture()) { |
| autoplayMediaEncountered(); |
| - if (m_userGestureRequiredForPlay) |
| + if (m_userGestureRequiredForPlay) { |
| + // prevent autoplay, and make it known |
|
jww
2015/06/03 22:58:51
Please remove this comment, as it is unnecessary.
keenanb
2015/06/04 00:07:13
Done.
|
| + String messageString = ExceptionMessages::failedToExecute( |
| + "play", |
|
jww
2015/06/03 22:58:51
Please put these arguments on one line.
keenanb
2015/06/04 00:07:13
Done.
|
| + "MediaElement", |
| + "the API can be initiated only by the user."); |
|
jww
2015/06/03 22:58:51
Please make this message match the message in the
keenanb
2015/06/04 00:07:13
Done.
|
| + document().executionContext()->addConsoleMessage( |
| + ConsoleMessage::create(JSMessageSource, WarningMessageLevel, messageString)); |
|
jww
2015/06/03 22:58:51
Please put this argument on the previous line.
keenanb
2015/06/04 00:07:12
Done.
|
| return; |
| + } |
| } else if (m_userGestureRequiredForPlay) { |
| if (m_autoplayMediaCounted) |
| recordAutoplayMetric(AutoplayManualStart); |