| Index: Source/core/html/HTMLMediaElement.h
|
| diff --git a/Source/core/html/HTMLMediaElement.h b/Source/core/html/HTMLMediaElement.h
|
| index ca381547f012a480c77082af3fadf6a7b1f44aaf..fc2cca402a91507f874721c150ae2707d4c2cce6 100644
|
| --- a/Source/core/html/HTMLMediaElement.h
|
| +++ b/Source/core/html/HTMLMediaElement.h
|
| @@ -29,6 +29,7 @@
|
| #include "core/CoreExport.h"
|
| #include "core/dom/ActiveDOMObject.h"
|
| #include "core/events/GenericEventQueue.h"
|
| +#include "core/html/AutoplayExperimentHelper.h"
|
| #include "core/html/HTMLElement.h"
|
| #include "core/html/track/TextTrack.h"
|
| #include "platform/Supplementable.h"
|
| @@ -262,6 +263,9 @@ public:
|
| virtual bool isHTMLAudioElement() const { return false; }
|
| virtual bool isHTMLVideoElement() const { return false; }
|
|
|
| + // Temporary callback for crbug.com/487345,402044
|
| + void notifyPositionMayHaveChanged();
|
| +
|
| protected:
|
| HTMLMediaElement(const QualifiedName&, Document&);
|
| ~HTMLMediaElement() override;
|
| @@ -386,7 +390,13 @@ private:
|
| // This does not check user gesture restrictions.
|
| void playInternal();
|
|
|
| - void gesturelessInitialPlayHalted();
|
| + // If we are about to enter a paused state, call this to record
|
| + // autoplay metrics. If we were already in a stopped state, then
|
| + // this does nothing.
|
| + void recordMetricsIfPausing();
|
| + // Could stopping at this point be considered a bailout of playback?
|
| + // (as in, "The user really didn't want to play this").
|
| + bool isBailout() const;
|
| void autoplayMediaEncountered();
|
| void allowVideoRendering();
|
|
|
| @@ -424,6 +434,8 @@ private:
|
|
|
| void setAllowHiddenVolumeControls(bool);
|
|
|
| + void recordAutoplayMetric(AutoplayMetrics);
|
| +
|
| WebMediaPlayer::CORSMode corsMode() const;
|
|
|
| // Returns the "direction of playback" value as specified in the HTML5 spec.
|
| @@ -443,8 +455,17 @@ private:
|
| // transition to HAVE_METADATA.
|
| void selectInitialTracksIfNecessary();
|
|
|
| + // Return true if and only if we require a user gesture before letting
|
| + // the media play.
|
| + bool isUserGestureRequiredForPlay() const;
|
| + void removeUserGestureRequirement();
|
| + void setInitialPlayWithoutUserGestures(bool);
|
| +
|
| void audioTracksTimerFired(Timer<HTMLMediaElement>*);
|
|
|
| + // For tests.
|
| + void triggerAutoplayViewportCheck();
|
| +
|
| Timer<HTMLMediaElement> m_loadTimer;
|
| Timer<HTMLMediaElement> m_progressEventTimer;
|
| Timer<HTMLMediaElement> m_playbackProgressTimer;
|
| @@ -544,7 +565,7 @@ private:
|
| bool m_remoteRoutesAvailable : 1;
|
| bool m_playingRemotely : 1;
|
| bool m_isFinalizing : 1;
|
| - bool m_initialPlayWithoutUserGestures : 1;
|
| + bool m_initialPlayWithoutUserGesture : 1;
|
| bool m_autoplayMediaCounted : 1;
|
| // Whether this element is in overlay fullscreen mode.
|
| bool m_inOverlayFullscreenVideo : 1;
|
| @@ -617,6 +638,9 @@ private:
|
|
|
| friend class Internals;
|
| friend class TrackDisplayUpdateScope;
|
| + friend class AutoplayExperimentHelper;
|
| +
|
| + AutoplayExperimentHelper m_autoplayHelper;
|
|
|
| static URLRegistry* s_mediaStreamRegistry;
|
| };
|
|
|