| OLD | NEW |
| 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 2961 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2972 // spec says: | 2972 // spec says: |
| 2973 // 4.8.8 - Dynamically modifying a source element and its attribute when the | 2973 // 4.8.8 - Dynamically modifying a source element and its attribute when the |
| 2974 // element is already inserted in a video or audio element will have no | 2974 // element is already inserted in a video or audio element will have no |
| 2975 // effect. | 2975 // effect. |
| 2976 m_currentSourceNode = nullptr; | 2976 m_currentSourceNode = nullptr; |
| 2977 BLINK_MEDIA_LOG << "sourceWasRemoved(" << (void*)this | 2977 BLINK_MEDIA_LOG << "sourceWasRemoved(" << (void*)this |
| 2978 << ") - m_currentSourceNode set to 0"; | 2978 << ") - m_currentSourceNode set to 0"; |
| 2979 } | 2979 } |
| 2980 } | 2980 } |
| 2981 | 2981 |
| 2982 void HTMLMediaElement::timeChanged() { | 2982 void HTMLMediaElement::timeChanged(bool ended) { |
| 2983 BLINK_MEDIA_LOG << "timeChanged(" << (void*)this << ")"; | 2983 BLINK_MEDIA_LOG << "timeChanged(" << (void*)this << ")"; |
| 2984 | 2984 |
| 2985 cueTimeline().updateActiveCues(currentTime()); | 2985 cueTimeline().updateActiveCues(currentTime()); |
| 2986 | 2986 |
| 2987 invalidateCachedTime(); | 2987 invalidateCachedTime(); |
| 2988 | 2988 |
| 2989 // 4.8.10.9 steps 12-14. Needed if no ReadyState change is associated with the | 2989 // 4.8.10.9 steps 12-14. Needed if no ReadyState change is associated with the |
| 2990 // seek. | 2990 // seek. |
| 2991 if (m_seeking && m_readyState >= kHaveCurrentData && | 2991 if (m_seeking && m_readyState >= kHaveCurrentData && |
| 2992 !webMediaPlayer()->seeking()) | 2992 !webMediaPlayer()->seeking()) |
| 2993 finishSeek(); | 2993 finishSeek(); |
| 2994 | 2994 |
| 2995 // Always call scheduleTimeupdateEvent when the media engine reports a time | 2995 // Always call scheduleTimeupdateEvent when the media engine reports a time |
| 2996 // discontinuity, it will only queue a 'timeupdate' event if we haven't | 2996 // discontinuity, it will only queue a 'timeupdate' event if we haven't |
| 2997 // already posted one at the current movie time. | 2997 // already posted one at the current movie time. |
| 2998 scheduleTimeupdateEvent(false); | 2998 scheduleTimeupdateEvent(false); |
| 2999 | 2999 |
| 3000 double now = currentTime(); | 3000 if (ended) { |
| 3001 double dur = duration(); | |
| 3002 | |
| 3003 // When the current playback position reaches the end of the media resource | |
| 3004 // when the direction of playback is forwards, then the user agent must follow | |
| 3005 // these steps: | |
| 3006 if (!std::isnan(dur) && dur && now >= dur && | |
| 3007 getDirectionOfPlayback() == Forward) { | |
| 3008 // If the media element has a loop attribute specified | 3001 // If the media element has a loop attribute specified |
| 3009 if (loop()) { | 3002 if (loop()) { |
| 3010 // then seek to the earliest possible position of the media resource and | 3003 // then seek to the earliest possible position of the media resource and |
| 3011 // abort these steps. | 3004 // abort these steps. |
| 3012 seek(0); | 3005 seek(0); |
| 3013 } else { | 3006 } else { |
| 3014 // If the media element has still ended playback, and the direction of | 3007 // If the media element has still ended playback, and the direction of |
| 3015 // playback is still forwards, and paused is false, | 3008 // playback is still forwards, and paused is false, |
| 3016 if (!m_paused) { | 3009 if (!m_paused) { |
| 3017 // changes paused to true and fires a simple event named pause at the | 3010 // changes paused to true and fires a simple event named pause at the |
| (...skipping 1074 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4092 | 4085 |
| 4093 IntRect HTMLMediaElement::AutoplayHelperClientImpl::absoluteBoundingBoxRect() | 4086 IntRect HTMLMediaElement::AutoplayHelperClientImpl::absoluteBoundingBoxRect() |
| 4094 const { | 4087 const { |
| 4095 IntRect result; | 4088 IntRect result; |
| 4096 if (LayoutObject* object = m_element->layoutObject()) | 4089 if (LayoutObject* object = m_element->layoutObject()) |
| 4097 result = object->absoluteBoundingBoxRect(); | 4090 result = object->absoluteBoundingBoxRect(); |
| 4098 return result; | 4091 return result; |
| 4099 } | 4092 } |
| 4100 | 4093 |
| 4101 } // namespace blink | 4094 } // namespace blink |
| OLD | NEW |