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 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
622 { | 622 { |
623 for (size_t index = 0; index < m_mediaElements.size(); ++index) { | 623 for (size_t index = 0; index < m_mediaElements.size(); ++index) { |
624 if (!m_mediaElements[index]->hasCurrentSrc()) | 624 if (!m_mediaElements[index]->hasCurrentSrc()) |
625 return false; | 625 return false; |
626 } | 626 } |
627 return true; | 627 return true; |
628 } | 628 } |
629 | 629 |
630 const AtomicString& MediaController::interfaceName() const | 630 const AtomicString& MediaController::interfaceName() const |
631 { | 631 { |
632 return eventNames().interfaceForMediaController; | 632 return EventTargetNames::MediaController; |
633 } | 633 } |
634 | 634 |
635 // The spec says to fire periodic timeupdate events (those sent while playing) e
very | 635 // The spec says to fire periodic timeupdate events (those sent while playing) e
very |
636 // "15 to 250ms", we choose the slowest frequency | 636 // "15 to 250ms", we choose the slowest frequency |
637 static const double maxTimeupdateEventFrequency = 0.25; | 637 static const double maxTimeupdateEventFrequency = 0.25; |
638 | 638 |
639 void MediaController::startTimeupdateTimer() | 639 void MediaController::startTimeupdateTimer() |
640 { | 640 { |
641 if (m_timeupdateTimer.isActive()) | 641 if (m_timeupdateTimer.isActive()) |
642 return; | 642 return; |
(...skipping 10 matching lines...) Expand all Loading... |
653 { | 653 { |
654 double now = WTF::currentTime(); | 654 double now = WTF::currentTime(); |
655 double timedelta = now - m_previousTimeupdateTime; | 655 double timedelta = now - m_previousTimeupdateTime; |
656 | 656 |
657 if (timedelta < maxTimeupdateEventFrequency) | 657 if (timedelta < maxTimeupdateEventFrequency) |
658 return; | 658 return; |
659 | 659 |
660 scheduleEvent(EventTypeNames::timeupdate); | 660 scheduleEvent(EventTypeNames::timeupdate); |
661 m_previousTimeupdateTime = now; | 661 m_previousTimeupdateTime = now; |
662 } | 662 } |
OLD | NEW |