| OLD | NEW |
| 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 1632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1643 // Check for autoplay, and record metrics about it if needed. | 1643 // Check for autoplay, and record metrics about it if needed. |
| 1644 if (shouldAutoplay(RecordMetricsBehavior::DoRecord)) { | 1644 if (shouldAutoplay(RecordMetricsBehavior::DoRecord)) { |
| 1645 recordAutoplaySourceMetric(AutoplaySourceAttribute); | 1645 recordAutoplaySourceMetric(AutoplaySourceAttribute); |
| 1646 | 1646 |
| 1647 // If the autoplay experiment says that it's okay to play now, | 1647 // If the autoplay experiment says that it's okay to play now, |
| 1648 // then don't require a user gesture. | 1648 // then don't require a user gesture. |
| 1649 m_autoplayHelper->becameReadyToPlay(); | 1649 m_autoplayHelper->becameReadyToPlay(); |
| 1650 | 1650 |
| 1651 if (!isGestureNeededForPlayback()) { | 1651 if (!isGestureNeededForPlayback()) { |
| 1652 if (isHTMLVideoElement() && muted() && RuntimeEnabledFeatures::a
utoplayMutedVideosEnabled()) { | 1652 if (isHTMLVideoElement() && muted() && RuntimeEnabledFeatures::a
utoplayMutedVideosEnabled()) { |
| 1653 m_autoplayVisibilityObserver = new ElementVisibilityObserver
(this, WTF::bind(&HTMLMediaElement::onVisibilityChangedForAutoplay, this)); | 1653 m_autoplayVisibilityObserver = new ElementVisibilityObserver
(this, WTF::bind(&HTMLMediaElement::onVisibilityChangedForAutoplay, wrapPersiste
nt(this))); |
| 1654 m_autoplayVisibilityObserver->start(); | 1654 m_autoplayVisibilityObserver->start(); |
| 1655 } else { | 1655 } else { |
| 1656 m_paused = false; | 1656 m_paused = false; |
| 1657 invalidateCachedTime(); | 1657 invalidateCachedTime(); |
| 1658 scheduleEvent(EventTypeNames::play); | 1658 scheduleEvent(EventTypeNames::play); |
| 1659 scheduleNotifyPlaying(); | 1659 scheduleNotifyPlaying(); |
| 1660 m_autoplaying = false; | 1660 m_autoplaying = false; |
| 1661 } | 1661 } |
| 1662 } | 1662 } |
| 1663 } | 1663 } |
| (...skipping 2351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4015 | 4015 |
| 4016 IntRect HTMLMediaElement::AutoplayHelperClientImpl::absoluteBoundingBoxRect() co
nst | 4016 IntRect HTMLMediaElement::AutoplayHelperClientImpl::absoluteBoundingBoxRect() co
nst |
| 4017 { | 4017 { |
| 4018 IntRect result; | 4018 IntRect result; |
| 4019 if (LayoutObject* object = m_element->layoutObject()) | 4019 if (LayoutObject* object = m_element->layoutObject()) |
| 4020 result = object->absoluteBoundingBoxRect(); | 4020 result = object->absoluteBoundingBoxRect(); |
| 4021 return result; | 4021 return result; |
| 4022 } | 4022 } |
| 4023 | 4023 |
| 4024 } // namespace blink | 4024 } // namespace blink |
| OLD | NEW |