OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2011 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 bringElementUpToSpeed(element); | 76 bringElementUpToSpeed(element); |
77 } | 77 } |
78 | 78 |
79 void MediaController::removeMediaElement(HTMLMediaElement* element) | 79 void MediaController::removeMediaElement(HTMLMediaElement* element) |
80 { | 80 { |
81 ASSERT(element); | 81 ASSERT(element); |
82 ASSERT(m_mediaElements.contains(element)); | 82 ASSERT(m_mediaElements.contains(element)); |
83 m_mediaElements.remove(m_mediaElements.find(element)); | 83 m_mediaElements.remove(m_mediaElements.find(element)); |
84 } | 84 } |
85 | 85 |
86 bool MediaController::containsMediaElement(HTMLMediaElement* element) const | |
87 { | |
88 return m_mediaElements.contains(element); | |
89 } | |
90 | |
91 PassRefPtr<TimeRanges> MediaController::buffered() const | 86 PassRefPtr<TimeRanges> MediaController::buffered() const |
92 { | 87 { |
93 if (m_mediaElements.isEmpty()) | 88 if (m_mediaElements.isEmpty()) |
94 return TimeRanges::create(); | 89 return TimeRanges::create(); |
95 | 90 |
96 // The buffered attribute must return a new static normalized TimeRanges obj
ect that represents | 91 // The buffered attribute must return a new static normalized TimeRanges obj
ect that represents |
97 // the intersection of the ranges of the media resources of the slaved media
elements that the | 92 // the intersection of the ranges of the media resources of the slaved media
elements that the |
98 // user agent has buffered, at the time the attribute is evaluated. | 93 // user agent has buffered, at the time the attribute is evaluated. |
99 RefPtr<TimeRanges> bufferedRanges = m_mediaElements.first()->buffered(); | 94 RefPtr<TimeRanges> bufferedRanges = m_mediaElements.first()->buffered(); |
100 for (size_t index = 1; index < m_mediaElements.size(); ++index) | 95 for (size_t index = 1; index < m_mediaElements.size(); ++index) |
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
638 { | 633 { |
639 double now = WTF::currentTime(); | 634 double now = WTF::currentTime(); |
640 double timedelta = now - m_previousTimeupdateTime; | 635 double timedelta = now - m_previousTimeupdateTime; |
641 | 636 |
642 if (timedelta < maxTimeupdateEventFrequency) | 637 if (timedelta < maxTimeupdateEventFrequency) |
643 return; | 638 return; |
644 | 639 |
645 scheduleEvent(EventTypeNames::timeupdate); | 640 scheduleEvent(EventTypeNames::timeupdate); |
646 m_previousTimeupdateTime = now; | 641 m_previousTimeupdateTime = now; |
647 } | 642 } |
OLD | NEW |