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

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

Issue 2047333002: Pause autoplay muted video when unmuting if there's no user gesture (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@autoplay-flag
Patch Set: Fixed accidental ws change 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 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 459
460 // If the user gesture is required, then this will remove it. Note that 460 // If the user gesture is required, then this will remove it. Note that
461 // one should not generally call this method directly; use the one on 461 // one should not generally call this method directly; use the one on
462 // m_helper and give it a reason. 462 // m_helper and give it a reason.
463 void unlockUserGesture(); 463 void unlockUserGesture();
464 464
465 // Return true if and only if a user gesture is requried for playback. Even 465 // Return true if and only if a user gesture is requried for playback. Even
466 // if isLockedPendingUserGesture() return true, this might return false if 466 // if isLockedPendingUserGesture() return true, this might return false if
467 // the requirement is currently overridden. This does not check if a user 467 // the requirement is currently overridden. This does not check if a user
468 // gesture is currently being processed. 468 // gesture is currently being processed.
469 bool isGestureNeededForPlayback() const; 469 bool isGestureNeededForPlayback();
470 470
471 void setNetworkState(NetworkState); 471 void setNetworkState(NetworkState);
472 472
473 void audioTracksTimerFired(Timer<HTMLMediaElement>*); 473 void audioTracksTimerFired(Timer<HTMLMediaElement>*);
474 474
475 // TODO(liberato): remove once autoplay gesture override experiment conclude s. 475 // TODO(liberato): remove once autoplay gesture override experiment conclude s.
476 void triggerAutoplayViewportCheckForTesting(); 476 void triggerAutoplayViewportCheckForTesting();
477 477
478 void scheduleResolvePlayPromises(); 478 void scheduleResolvePlayPromises();
479 void scheduleRejectPlayPromises(ExceptionCode); 479 void scheduleRejectPlayPromises(ExceptionCode);
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
575 bool m_textTracksVisible : 1; 575 bool m_textTracksVisible : 1;
576 bool m_shouldPerformAutomaticTrackSelection : 1; 576 bool m_shouldPerformAutomaticTrackSelection : 1;
577 577
578 bool m_tracksAreReady : 1; 578 bool m_tracksAreReady : 1;
579 bool m_processingPreferenceChange : 1; 579 bool m_processingPreferenceChange : 1;
580 bool m_remoteRoutesAvailable : 1; 580 bool m_remoteRoutesAvailable : 1;
581 bool m_playingRemotely : 1; 581 bool m_playingRemotely : 1;
582 // Whether this element is in overlay fullscreen mode. 582 // Whether this element is in overlay fullscreen mode.
583 bool m_inOverlayFullscreenVideo : 1; 583 bool m_inOverlayFullscreenVideo : 1;
584 584
585 // Whether this element is autoplaying due to being muted.
586 bool m_isAutoplayingMuted : 1;
587
585 Member<AudioTrackList> m_audioTracks; 588 Member<AudioTrackList> m_audioTracks;
586 Member<VideoTrackList> m_videoTracks; 589 Member<VideoTrackList> m_videoTracks;
587 Member<TextTrackList> m_textTracks; 590 Member<TextTrackList> m_textTracks;
588 HeapVector<Member<TextTrack>> m_textTracksWhenResourceSelectionBegan; 591 HeapVector<Member<TextTrack>> m_textTracksWhenResourceSelectionBegan;
589 592
590 Member<CueTimeline> m_cueTimeline; 593 Member<CueTimeline> m_cueTimeline;
591 594
592 HeapVector<Member<ScriptPromiseResolver>> m_playPromiseResolvers; 595 HeapVector<Member<ScriptPromiseResolver>> m_playPromiseResolvers;
593 OwnPtr<CancellableTaskFactory> m_playPromiseResolveTask; 596 OwnPtr<CancellableTaskFactory> m_playPromiseResolveTask;
594 OwnPtr<CancellableTaskFactory> m_playPromiseRejectTask; 597 OwnPtr<CancellableTaskFactory> m_playPromiseRejectTask;
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
668 inline bool isHTMLMediaElement(const HTMLElement& element) 671 inline bool isHTMLMediaElement(const HTMLElement& element)
669 { 672 {
670 return isHTMLAudioElement(element) || isHTMLVideoElement(element); 673 return isHTMLAudioElement(element) || isHTMLVideoElement(element);
671 } 674 }
672 675
673 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement); 676 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement);
674 677
675 } // namespace blink 678 } // namespace blink
676 679
677 #endif // HTMLMediaElement_h 680 #endif // HTMLMediaElement_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698