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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 // If the new playback position is greater than the media controller duratio
n, then set it | 164 // If the new playback position is greater than the media controller duratio
n, then set it |
165 // to the media controller duration. | 165 // to the media controller duration. |
166 time = min(time, duration()); | 166 time = min(time, duration()); |
167 | 167 |
168 // Set the media controller position to the new playback position. | 168 // Set the media controller position to the new playback position. |
169 m_position = time; | 169 m_position = time; |
170 m_clock->setCurrentTime(time); | 170 m_clock->setCurrentTime(time); |
171 | 171 |
172 // Seek each slaved media element to the new playback position relative to t
he media element timeline. | 172 // Seek each slaved media element to the new playback position relative to t
he media element timeline. |
173 for (size_t index = 0; index < m_mediaElements.size(); ++index) | 173 for (size_t index = 0; index < m_mediaElements.size(); ++index) |
174 m_mediaElements[index]->seek(time, exceptionState); | 174 m_mediaElements[index]->seek(HTMLMediaElement::SkipAllowed, time, except
ionState); |
175 | 175 |
176 scheduleTimeupdateEvent(); | 176 scheduleTimeupdateEvent(); |
177 } | 177 } |
178 | 178 |
179 void MediaController::unpause() | 179 void MediaController::unpause() |
180 { | 180 { |
181 // When the unpause() method is invoked, if the MediaController is a paused
media controller, | 181 // When the unpause() method is invoked, if the MediaController is a paused
media controller, |
182 if (!m_paused) | 182 if (!m_paused) |
183 return; | 183 return; |
184 | 184 |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
472 } | 472 } |
473 | 473 |
474 void MediaController::bringElementUpToSpeed(HTMLMediaElement* element) | 474 void MediaController::bringElementUpToSpeed(HTMLMediaElement* element) |
475 { | 475 { |
476 ASSERT(element); | 476 ASSERT(element); |
477 ASSERT(m_mediaElements.contains(element)); | 477 ASSERT(m_mediaElements.contains(element)); |
478 | 478 |
479 // When the user agent is to bring a media element up to speed with its new
media controller, | 479 // When the user agent is to bring a media element up to speed with its new
media controller, |
480 // it must seek that media element to the MediaController's media controller
position relative | 480 // it must seek that media element to the MediaController's media controller
position relative |
481 // to the media element's timeline. | 481 // to the media element's timeline. |
482 element->seek(currentTime(), IGNORE_EXCEPTION); | 482 element->seek(HTMLMediaElement::SkipAllowed, currentTime(), IGNORE_EXCEPTION
); |
483 } | 483 } |
484 | 484 |
485 bool MediaController::isRestrained() const | 485 bool MediaController::isRestrained() const |
486 { | 486 { |
487 ASSERT(!m_mediaElements.isEmpty()); | 487 ASSERT(!m_mediaElements.isEmpty()); |
488 | 488 |
489 // A MediaController is a restrained media controller if the MediaController
is a playing media | 489 // A MediaController is a restrained media controller if the MediaController
is a playing media |
490 // controller, | 490 // controller, |
491 if (m_paused) | 491 if (m_paused) |
492 return false; | 492 return false; |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
598 { | 598 { |
599 double now = WTF::currentTime(); | 599 double now = WTF::currentTime(); |
600 double timedelta = now - m_previousTimeupdateTime; | 600 double timedelta = now - m_previousTimeupdateTime; |
601 | 601 |
602 if (timedelta < maxTimeupdateEventFrequency) | 602 if (timedelta < maxTimeupdateEventFrequency) |
603 return; | 603 return; |
604 | 604 |
605 scheduleEvent(EventTypeNames::timeupdate); | 605 scheduleEvent(EventTypeNames::timeupdate); |
606 m_previousTimeupdateTime = now; | 606 m_previousTimeupdateTime = now; |
607 } | 607 } |
OLD | NEW |