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

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

Issue 2654123002: Autoplay muted video when visible and pause when invisible (Closed)
Patch Set: fixed tests Created 3 years, 10 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 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights
3 * reserved. 3 * reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 void setOfficialPlaybackPosition(double) const; 480 void setOfficialPlaybackPosition(double) const;
481 void requireOfficialPlaybackPositionUpdate() const; 481 void requireOfficialPlaybackPositionUpdate() const;
482 482
483 void ensureMediaControls(); 483 void ensureMediaControls();
484 void updateControlsVisibility(); 484 void updateControlsVisibility();
485 485
486 TextTrackContainer& ensureTextTrackContainer(); 486 TextTrackContainer& ensureTextTrackContainer();
487 487
488 void changeNetworkStateFromLoadingToIdle(); 488 void changeNetworkStateFromLoadingToIdle();
489 489
490 bool isAutoplaying() const { return m_autoplaying; }
491
492 WebMediaPlayer::CORSMode corsMode() const; 490 WebMediaPlayer::CORSMode corsMode() const;
493 491
494 // Returns the "direction of playback" value as specified in the HTML5 spec. 492 // Returns the "direction of playback" value as specified in the HTML5 spec.
495 enum DirectionOfPlayback { Backward, Forward }; 493 enum DirectionOfPlayback { Backward, Forward };
496 DirectionOfPlayback getDirectionOfPlayback() const; 494 DirectionOfPlayback getDirectionOfPlayback() const;
497 495
498 // Creates placeholder AudioTrack and/or VideoTrack objects when 496 // Creates placeholder AudioTrack and/or VideoTrack objects when
499 // WebMemediaPlayer objects advertise they have audio and/or video, but don't 497 // WebMemediaPlayer objects advertise they have audio and/or video, but don't
500 // explicitly signal them via addAudioTrack() and addVideoTrack(). 498 // explicitly signal them via addAudioTrack() and addVideoTrack().
501 // FIXME: Remove this once all WebMediaPlayer implementations properly report 499 // FIXME: Remove this once all WebMediaPlayer implementations properly report
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
632 630
633 typedef unsigned PendingActionFlags; 631 typedef unsigned PendingActionFlags;
634 PendingActionFlags m_pendingActionFlags; 632 PendingActionFlags m_pendingActionFlags;
635 633
636 // FIXME: HTMLMediaElement has way too many state bits. 634 // FIXME: HTMLMediaElement has way too many state bits.
637 bool m_lockedPendingUserGesture : 1; 635 bool m_lockedPendingUserGesture : 1;
638 bool m_lockedPendingUserGestureIfCrossOriginExperimentEnabled : 1; 636 bool m_lockedPendingUserGestureIfCrossOriginExperimentEnabled : 1;
639 bool m_playing : 1; 637 bool m_playing : 1;
640 bool m_shouldDelayLoadEvent : 1; 638 bool m_shouldDelayLoadEvent : 1;
641 bool m_haveFiredLoadedData : 1; 639 bool m_haveFiredLoadedData : 1;
642 bool m_autoplaying : 1; 640 bool m_canAutoplay : 1;
643 bool m_muted : 1; 641 bool m_muted : 1;
644 bool m_paused : 1; 642 bool m_paused : 1;
645 bool m_seeking : 1; 643 bool m_seeking : 1;
646 644
647 // data has not been loaded since sending a "stalled" event 645 // data has not been loaded since sending a "stalled" event
648 bool m_sentStalledEvent : 1; 646 bool m_sentStalledEvent : 1;
649 647
650 bool m_ignorePreloadNone : 1; 648 bool m_ignorePreloadNone : 1;
651 649
652 bool m_textTracksVisible : 1; 650 bool m_textTracksVisible : 1;
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
752 750
753 inline bool isHTMLMediaElement(const HTMLElement& element) { 751 inline bool isHTMLMediaElement(const HTMLElement& element) {
754 return isHTMLAudioElement(element) || isHTMLVideoElement(element); 752 return isHTMLAudioElement(element) || isHTMLVideoElement(element);
755 } 753 }
756 754
757 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement); 755 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement);
758 756
759 } // namespace blink 757 } // namespace blink
760 758
761 #endif // HTMLMediaElement_h 759 #endif // HTMLMediaElement_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698