| 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 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 494 | 494 |
| 495 if ((actionType & LoadMediaResource) && !(m_pendingActionFlags & LoadMediaRe
source)) { | 495 if ((actionType & LoadMediaResource) && !(m_pendingActionFlags & LoadMediaRe
source)) { |
| 496 prepareForLoad(); | 496 prepareForLoad(); |
| 497 m_pendingActionFlags |= LoadMediaResource; | 497 m_pendingActionFlags |= LoadMediaResource; |
| 498 } | 498 } |
| 499 | 499 |
| 500 if (RuntimeEnabledFeatures::videoTrackEnabled() && (actionType & LoadTextTra
ckResource)) | 500 if (RuntimeEnabledFeatures::videoTrackEnabled() && (actionType & LoadTextTra
ckResource)) |
| 501 m_pendingActionFlags |= LoadTextTrackResource; | 501 m_pendingActionFlags |= LoadTextTrackResource; |
| 502 | 502 |
| 503 if (!m_loadTimer.isActive()) | 503 if (!m_loadTimer.isActive()) |
| 504 m_loadTimer.startOneShot(0); | 504 m_loadTimer.startOneShot(0, FROM_HERE); |
| 505 } | 505 } |
| 506 | 506 |
| 507 void HTMLMediaElement::scheduleNextSourceChild() | 507 void HTMLMediaElement::scheduleNextSourceChild() |
| 508 { | 508 { |
| 509 // Schedule the timer to try the next <source> element WITHOUT resetting sta
te ala prepareForLoad. | 509 // Schedule the timer to try the next <source> element WITHOUT resetting sta
te ala prepareForLoad. |
| 510 m_pendingActionFlags |= LoadMediaResource; | 510 m_pendingActionFlags |= LoadMediaResource; |
| 511 m_loadTimer.startOneShot(0); | 511 m_loadTimer.startOneShot(0, FROM_HERE); |
| 512 } | 512 } |
| 513 | 513 |
| 514 void HTMLMediaElement::scheduleEvent(const AtomicString& eventName) | 514 void HTMLMediaElement::scheduleEvent(const AtomicString& eventName) |
| 515 { | 515 { |
| 516 scheduleEvent(Event::createCancelable(eventName)); | 516 scheduleEvent(Event::createCancelable(eventName)); |
| 517 } | 517 } |
| 518 | 518 |
| 519 void HTMLMediaElement::scheduleEvent(PassRefPtr<Event> event) | 519 void HTMLMediaElement::scheduleEvent(PassRefPtr<Event> event) |
| 520 { | 520 { |
| 521 #if LOG_MEDIA_EVENTS | 521 #if LOG_MEDIA_EVENTS |
| (...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1306 return true; | 1306 return true; |
| 1307 } | 1307 } |
| 1308 | 1308 |
| 1309 void HTMLMediaElement::startProgressEventTimer() | 1309 void HTMLMediaElement::startProgressEventTimer() |
| 1310 { | 1310 { |
| 1311 if (m_progressEventTimer.isActive()) | 1311 if (m_progressEventTimer.isActive()) |
| 1312 return; | 1312 return; |
| 1313 | 1313 |
| 1314 m_previousProgressTime = WTF::currentTime(); | 1314 m_previousProgressTime = WTF::currentTime(); |
| 1315 // 350ms is not magic, it is in the spec! | 1315 // 350ms is not magic, it is in the spec! |
| 1316 m_progressEventTimer.startRepeating(0.350); | 1316 m_progressEventTimer.startRepeating(0.350, FROM_HERE); |
| 1317 } | 1317 } |
| 1318 | 1318 |
| 1319 void HTMLMediaElement::waitForSourceChange() | 1319 void HTMLMediaElement::waitForSourceChange() |
| 1320 { | 1320 { |
| 1321 WTF_LOG(Media, "HTMLMediaElement::waitForSourceChange"); | 1321 WTF_LOG(Media, "HTMLMediaElement::waitForSourceChange"); |
| 1322 | 1322 |
| 1323 stopPeriodicTimers(); | 1323 stopPeriodicTimers(); |
| 1324 m_loadState = WaitingForSource; | 1324 m_loadState = WaitingForSource; |
| 1325 | 1325 |
| 1326 // 6.17 - Waiting: Set the element's networkState attribute to the NETWORK_N
O_SOURCE value | 1326 // 6.17 - Waiting: Set the element's networkState attribute to the NETWORK_N
O_SOURCE value |
| (...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2127 // The spec says to fire periodic timeupdate events (those sent while playing) e
very | 2127 // The spec says to fire periodic timeupdate events (those sent while playing) e
very |
| 2128 // "15 to 250ms", we choose the slowest frequency | 2128 // "15 to 250ms", we choose the slowest frequency |
| 2129 static const double maxTimeupdateEventFrequency = 0.25; | 2129 static const double maxTimeupdateEventFrequency = 0.25; |
| 2130 | 2130 |
| 2131 void HTMLMediaElement::startPlaybackProgressTimer() | 2131 void HTMLMediaElement::startPlaybackProgressTimer() |
| 2132 { | 2132 { |
| 2133 if (m_playbackProgressTimer.isActive()) | 2133 if (m_playbackProgressTimer.isActive()) |
| 2134 return; | 2134 return; |
| 2135 | 2135 |
| 2136 m_previousProgressTime = WTF::currentTime(); | 2136 m_previousProgressTime = WTF::currentTime(); |
| 2137 m_playbackProgressTimer.startRepeating(maxTimeupdateEventFrequency); | 2137 m_playbackProgressTimer.startRepeating(maxTimeupdateEventFrequency, FROM_HER
E); |
| 2138 } | 2138 } |
| 2139 | 2139 |
| 2140 void HTMLMediaElement::playbackProgressTimerFired(Timer<HTMLMediaElement>*) | 2140 void HTMLMediaElement::playbackProgressTimerFired(Timer<HTMLMediaElement>*) |
| 2141 { | 2141 { |
| 2142 ASSERT(m_player); | 2142 ASSERT(m_player); |
| 2143 | 2143 |
| 2144 if (m_fragmentEndTime != MediaPlayer::invalidTime() && currentTime() >= m_fr
agmentEndTime && m_playbackRate > 0) { | 2144 if (m_fragmentEndTime != MediaPlayer::invalidTime() && currentTime() >= m_fr
agmentEndTime && m_playbackRate > 0) { |
| 2145 m_fragmentEndTime = MediaPlayer::invalidTime(); | 2145 m_fragmentEndTime = MediaPlayer::invalidTime(); |
| 2146 if (!m_mediaController && !m_paused) { | 2146 if (!m_mediaController && !m_paused) { |
| 2147 UseCounter::count(document(), UseCounter::HTMLMediaElementPauseAtFra
gmentEnd); | 2147 UseCounter::count(document(), UseCounter::HTMLMediaElementPauseAtFra
gmentEnd); |
| (...skipping 1480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3628 { | 3628 { |
| 3629 m_mediaSource->setWebMediaSourceAndOpen(adoptPtr(webMediaSource)); | 3629 m_mediaSource->setWebMediaSourceAndOpen(adoptPtr(webMediaSource)); |
| 3630 } | 3630 } |
| 3631 | 3631 |
| 3632 bool HTMLMediaElement::isInteractiveContent() const | 3632 bool HTMLMediaElement::isInteractiveContent() const |
| 3633 { | 3633 { |
| 3634 return fastHasAttribute(controlsAttr); | 3634 return fastHasAttribute(controlsAttr); |
| 3635 } | 3635 } |
| 3636 | 3636 |
| 3637 } | 3637 } |
| OLD | NEW |