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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLMediaElement.h

Issue 2051253002: Start autoplay muted videos with autoplay attribute when they are visible. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 29 matching lines...) Expand all
40 #include "public/platform/WebAudioSourceProviderClient.h" 40 #include "public/platform/WebAudioSourceProviderClient.h"
41 #include "public/platform/WebMediaPlayerClient.h" 41 #include "public/platform/WebMediaPlayerClient.h"
42 #include "public/platform/WebMimeRegistry.h" 42 #include "public/platform/WebMimeRegistry.h"
43 43
44 namespace blink { 44 namespace blink {
45 45
46 class AudioSourceProviderClient; 46 class AudioSourceProviderClient;
47 class AudioTrackList; 47 class AudioTrackList;
48 class ContentType; 48 class ContentType;
49 class CueTimeline; 49 class CueTimeline;
50 class ElementVisibilityObserver;
50 class EnumerationHistogram; 51 class EnumerationHistogram;
51 class Event; 52 class Event;
52 class ExceptionState; 53 class ExceptionState;
53 class HTMLSourceElement; 54 class HTMLSourceElement;
54 class HTMLTrackElement; 55 class HTMLTrackElement;
55 class KURL; 56 class KURL;
56 class MediaControls; 57 class MediaControls;
57 class MediaError; 58 class MediaError;
58 class MediaStreamDescriptor; 59 class MediaStreamDescriptor;
59 class HTMLMediaSource; 60 class HTMLMediaSource;
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 void scheduleNotifyPlaying(); 481 void scheduleNotifyPlaying();
481 void resolveScheduledPlayPromises(); 482 void resolveScheduledPlayPromises();
482 void rejectScheduledPlayPromises(); 483 void rejectScheduledPlayPromises();
483 void rejectPlayPromises(ExceptionCode, const String&); 484 void rejectPlayPromises(ExceptionCode, const String&);
484 void rejectPlayPromisesInternal(ExceptionCode, const String&); 485 void rejectPlayPromisesInternal(ExceptionCode, const String&);
485 486
486 EnumerationHistogram& showControlsHistogram() const; 487 EnumerationHistogram& showControlsHistogram() const;
487 488
488 void recordAutoplaySourceMetric(int source); 489 void recordAutoplaySourceMetric(int source);
489 490
491 void visibilityChangedForAutoplay(bool visibility);
492
490 UnthrottledTimer<HTMLMediaElement> m_loadTimer; 493 UnthrottledTimer<HTMLMediaElement> m_loadTimer;
491 UnthrottledTimer<HTMLMediaElement> m_progressEventTimer; 494 UnthrottledTimer<HTMLMediaElement> m_progressEventTimer;
492 UnthrottledTimer<HTMLMediaElement> m_playbackProgressTimer; 495 UnthrottledTimer<HTMLMediaElement> m_playbackProgressTimer;
493 UnthrottledTimer<HTMLMediaElement> m_audioTracksTimer; 496 UnthrottledTimer<HTMLMediaElement> m_audioTracksTimer;
494 Member<TimeRanges> m_playedTimeRanges; 497 Member<TimeRanges> m_playedTimeRanges;
495 Member<GenericEventQueue> m_asyncEventQueue; 498 Member<GenericEventQueue> m_asyncEventQueue;
496 499
497 double m_playbackRate; 500 double m_playbackRate;
498 double m_defaultPlaybackRate; 501 double m_defaultPlaybackRate;
499 NetworkState m_networkState; 502 NetworkState m_networkState;
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
657 friend class Internals; 660 friend class Internals;
658 friend class TrackDisplayUpdateScope; 661 friend class TrackDisplayUpdateScope;
659 friend class AutoplayExperimentHelper; 662 friend class AutoplayExperimentHelper;
660 friend class MediaControlsTest; 663 friend class MediaControlsTest;
661 664
662 Member<AutoplayExperimentHelper::Client> m_autoplayHelperClient; 665 Member<AutoplayExperimentHelper::Client> m_autoplayHelperClient;
663 Member<AutoplayExperimentHelper> m_autoplayHelper; 666 Member<AutoplayExperimentHelper> m_autoplayHelper;
664 667
665 WebRemotePlaybackClient* m_remotePlaybackClient; 668 WebRemotePlaybackClient* m_remotePlaybackClient;
666 669
670 // class AutoplayVisibilityObserver;
671 Member<ElementVisibilityObserver> m_autoplayVisibilityObserver;
672
667 static URLRegistry* s_mediaStreamRegistry; 673 static URLRegistry* s_mediaStreamRegistry;
668 }; 674 };
669 675
670 inline bool isHTMLMediaElement(const HTMLElement& element) 676 inline bool isHTMLMediaElement(const HTMLElement& element)
671 { 677 {
672 return isHTMLAudioElement(element) || isHTMLVideoElement(element); 678 return isHTMLAudioElement(element) || isHTMLVideoElement(element);
673 } 679 }
674 680
675 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement); 681 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement);
676 682
677 } // namespace blink 683 } // namespace blink
678 684
679 #endif // HTMLMediaElement_h 685 #endif // HTMLMediaElement_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698