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

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

Issue 2065363002: [Android, Video, Autoplay] Only autoplay muted videos, ignore audio tags. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changed setTimeout to 0 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
« no previous file with comments | « third_party/WebKit/LayoutTests/media/autoplay-muted.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 3692 matching lines...) Expand 10 before | Expand all | Expand 10 after
3703 3703
3704 bool HTMLMediaElement::isGestureNeededForPlayback() const 3704 bool HTMLMediaElement::isGestureNeededForPlayback() const
3705 { 3705 {
3706 if (!m_lockedPendingUserGesture) 3706 if (!m_lockedPendingUserGesture)
3707 return false; 3707 return false;
3708 3708
3709 // We want to allow muted video to autoplay if: 3709 // We want to allow muted video to autoplay if:
3710 // - the flag is enabled; 3710 // - the flag is enabled;
3711 // - Data Saver is not enabled; 3711 // - Data Saver is not enabled;
3712 // - Autoplay is enabled in settings; 3712 // - Autoplay is enabled in settings;
3713 if (muted() 3713 if (isHTMLVideoElement()
3714 && muted()
3714 && RuntimeEnabledFeatures::autoplayMutedVideosEnabled() 3715 && RuntimeEnabledFeatures::autoplayMutedVideosEnabled()
3715 && !(document().settings() && document().settings()->dataSaverEnabled()) 3716 && !(document().settings() && document().settings()->dataSaverEnabled())
3716 && isAutoplayAllowedPerSettings()) { 3717 && isAutoplayAllowedPerSettings()) {
3717 return false; 3718 return false;
3718 } 3719 }
3719 3720
3720 if (m_autoplayHelper->isGestureRequirementOverridden()) 3721 if (m_autoplayHelper->isGestureRequirementOverridden())
3721 return false; 3722 return false;
3722 3723
3723 return true; 3724 return true;
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
3984 3985
3985 IntRect HTMLMediaElement::AutoplayHelperClientImpl::absoluteBoundingBoxRect() co nst 3986 IntRect HTMLMediaElement::AutoplayHelperClientImpl::absoluteBoundingBoxRect() co nst
3986 { 3987 {
3987 IntRect result; 3988 IntRect result;
3988 if (LayoutObject* object = m_element->layoutObject()) 3989 if (LayoutObject* object = m_element->layoutObject())
3989 result = object->absoluteBoundingBoxRect(); 3990 result = object->absoluteBoundingBoxRect();
3990 return result; 3991 return result;
3991 } 3992 }
3992 3993
3993 } // namespace blink 3994 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/media/autoplay-muted.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698