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 1550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1561 if (wasPotentiallyPlaying && m_readyState < HAVE_FUTURE_DATA) { | 1561 if (wasPotentiallyPlaying && m_readyState < HAVE_FUTURE_DATA) { |
1562 // 4.8.10.8 | 1562 // 4.8.10.8 |
1563 scheduleTimeupdateEvent(false); | 1563 scheduleTimeupdateEvent(false); |
1564 scheduleEvent(EventTypeNames::waiting); | 1564 scheduleEvent(EventTypeNames::waiting); |
1565 } | 1565 } |
1566 } | 1566 } |
1567 | 1567 |
1568 if (m_readyState >= HAVE_METADATA && oldState < HAVE_METADATA) { | 1568 if (m_readyState >= HAVE_METADATA && oldState < HAVE_METADATA) { |
1569 prepareMediaFragmentURI(); | 1569 prepareMediaFragmentURI(); |
1570 scheduleEvent(EventTypeNames::durationchange); | 1570 scheduleEvent(EventTypeNames::durationchange); |
1571 if (isVideo()) | 1571 if (isHTMLVideoElement(*this)) |
1572 scheduleEvent(EventTypeNames::resize); | 1572 scheduleEvent(EventTypeNames::resize); |
1573 scheduleEvent(EventTypeNames::loadedmetadata); | 1573 scheduleEvent(EventTypeNames::loadedmetadata); |
1574 if (hasMediaControls()) | 1574 if (hasMediaControls()) |
1575 mediaControls()->reset(); | 1575 mediaControls()->reset(); |
1576 if (renderer()) | 1576 if (renderer()) |
1577 renderer()->updateFromElement(); | 1577 renderer()->updateFromElement(); |
1578 } | 1578 } |
1579 | 1579 |
1580 bool shouldUpdateDisplayState = false; | 1580 bool shouldUpdateDisplayState = false; |
1581 | 1581 |
(...skipping 1264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2846 updateDisplayState(); | 2846 updateDisplayState(); |
2847 if (renderer()) | 2847 if (renderer()) |
2848 renderer()->repaint(); | 2848 renderer()->repaint(); |
2849 } | 2849 } |
2850 | 2850 |
2851 void HTMLMediaElement::mediaPlayerSizeChanged() | 2851 void HTMLMediaElement::mediaPlayerSizeChanged() |
2852 { | 2852 { |
2853 WTF_LOG(Media, "HTMLMediaElement::mediaPlayerSizeChanged"); | 2853 WTF_LOG(Media, "HTMLMediaElement::mediaPlayerSizeChanged"); |
2854 | 2854 |
2855 ASSERT(hasVideo()); // "resize" makes no sense absent video. | 2855 ASSERT(hasVideo()); // "resize" makes no sense absent video. |
2856 if (m_readyState > HAVE_NOTHING && isVideo()) | 2856 if (m_readyState > HAVE_NOTHING && isHTMLVideoElement(*this)) |
2857 scheduleEvent(EventTypeNames::resize); | 2857 scheduleEvent(EventTypeNames::resize); |
2858 | 2858 |
2859 if (renderer()) | 2859 if (renderer()) |
2860 renderer()->updateFromElement(); | 2860 renderer()->updateFromElement(); |
2861 } | 2861 } |
2862 | 2862 |
2863 PassRefPtr<TimeRanges> HTMLMediaElement::buffered() const | 2863 PassRefPtr<TimeRanges> HTMLMediaElement::buffered() const |
2864 { | 2864 { |
2865 if (!m_player) | 2865 if (!m_player) |
2866 return TimeRanges::create(); | 2866 return TimeRanges::create(); |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3173 WTF_LOG(Media, "HTMLMediaElement::enterFullscreen"); | 3173 WTF_LOG(Media, "HTMLMediaElement::enterFullscreen"); |
3174 | 3174 |
3175 if (document().settings() && document().settings()->fullScreenEnabled()) | 3175 if (document().settings() && document().settings()->fullScreenEnabled()) |
3176 FullscreenElementStack::from(document()).requestFullScreenForElement(thi
s, 0, FullscreenElementStack::ExemptIFrameAllowFullScreenRequirement); | 3176 FullscreenElementStack::from(document()).requestFullScreenForElement(thi
s, 0, FullscreenElementStack::ExemptIFrameAllowFullScreenRequirement); |
3177 } | 3177 } |
3178 | 3178 |
3179 void HTMLMediaElement::didBecomeFullscreenElement() | 3179 void HTMLMediaElement::didBecomeFullscreenElement() |
3180 { | 3180 { |
3181 if (hasMediaControls()) | 3181 if (hasMediaControls()) |
3182 mediaControls()->enteredFullscreen(); | 3182 mediaControls()->enteredFullscreen(); |
3183 if (RuntimeEnabledFeatures::overlayFullscreenVideoEnabled() && isVideo()) | 3183 if (RuntimeEnabledFeatures::overlayFullscreenVideoEnabled() && isHTMLVideoEl
ement(*this)) |
3184 document().renderView()->compositor()->setCompositingLayersNeedRebuild()
; | 3184 document().renderView()->compositor()->setCompositingLayersNeedRebuild()
; |
3185 } | 3185 } |
3186 | 3186 |
3187 void HTMLMediaElement::willStopBeingFullscreenElement() | 3187 void HTMLMediaElement::willStopBeingFullscreenElement() |
3188 { | 3188 { |
3189 if (hasMediaControls()) | 3189 if (hasMediaControls()) |
3190 mediaControls()->exitedFullscreen(); | 3190 mediaControls()->exitedFullscreen(); |
3191 if (RuntimeEnabledFeatures::overlayFullscreenVideoEnabled() && isVideo()) | 3191 if (RuntimeEnabledFeatures::overlayFullscreenVideoEnabled() && isHTMLVideoEl
ement(*this)) |
3192 document().renderView()->compositor()->setCompositingLayersNeedRebuild()
; | 3192 document().renderView()->compositor()->setCompositingLayersNeedRebuild()
; |
3193 } | 3193 } |
3194 | 3194 |
3195 blink::WebLayer* HTMLMediaElement::platformLayer() const | 3195 blink::WebLayer* HTMLMediaElement::platformLayer() const |
3196 { | 3196 { |
3197 return m_webLayer; | 3197 return m_webLayer; |
3198 } | 3198 } |
3199 | 3199 |
3200 bool HTMLMediaElement::hasClosedCaptions() const | 3200 bool HTMLMediaElement::hasClosedCaptions() const |
3201 { | 3201 { |
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3618 { | 3618 { |
3619 m_mediaSource->setWebMediaSourceAndOpen(adoptPtr(webMediaSource)); | 3619 m_mediaSource->setWebMediaSourceAndOpen(adoptPtr(webMediaSource)); |
3620 } | 3620 } |
3621 | 3621 |
3622 bool HTMLMediaElement::isInteractiveContent() const | 3622 bool HTMLMediaElement::isInteractiveContent() const |
3623 { | 3623 { |
3624 return fastHasAttribute(controlsAttr); | 3624 return fastHasAttribute(controlsAttr); |
3625 } | 3625 } |
3626 | 3626 |
3627 } | 3627 } |
OLD | NEW |