Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011, 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2011, 2012 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. | 3 * Copyright (C) 2011, 2012 Google Inc. All rights 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 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 376 void MediaControls::beginScrubbing() | 376 void MediaControls::beginScrubbing() |
| 377 { | 377 { |
| 378 if (!mediaElement().paused()) { | 378 if (!mediaElement().paused()) { |
| 379 m_isPausedForScrubbing = true; | 379 m_isPausedForScrubbing = true; |
| 380 mediaElement().pause(); | 380 mediaElement().pause(); |
| 381 } | 381 } |
| 382 } | 382 } |
| 383 | 383 |
| 384 void MediaControls::endScrubbing() | 384 void MediaControls::endScrubbing() |
| 385 { | 385 { |
| 386 if (m_isPausedForScrubbing) { | 386 if (!m_isPausedForScrubbing) |
| 387 m_isPausedForScrubbing = false; | 387 return; |
| 388 if (mediaElement().paused()) | 388 |
| 389 mediaElement().play(); | 389 m_isPausedForScrubbing = false; |
| 390 } | 390 if (mediaElement().paused()) |
| 391 mediaElement().playInternal(); | |
|
philipj_slow
2016/02/02 09:56:33
Hmm, this case need not require a user gesture, bu
mlamouri (slow - plz ping)
2016/02/03 19:28:58
Fixed.
| |
| 391 } | 392 } |
| 392 | 393 |
| 393 void MediaControls::updateCurrentTimeDisplay() | 394 void MediaControls::updateCurrentTimeDisplay() |
| 394 { | 395 { |
| 395 double now = mediaElement().currentTime(); | 396 double now = mediaElement().currentTime(); |
| 396 double duration = mediaElement().duration(); | 397 double duration = mediaElement().duration(); |
| 397 | 398 |
| 398 // After seek, hide duration display and show current time. | 399 // After seek, hide duration display and show current time. |
| 399 if (!RuntimeEnabledFeatures::newMediaPlaybackUiEnabled() && now > 0) { | 400 if (!RuntimeEnabledFeatures::newMediaPlaybackUiEnabled() && now > 0) { |
| 400 BatchedControlUpdate batch(this); | 401 BatchedControlUpdate batch(this); |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 749 visitor->trace(m_toggleClosedCaptionsButton); | 750 visitor->trace(m_toggleClosedCaptionsButton); |
| 750 visitor->trace(m_fullScreenButton); | 751 visitor->trace(m_fullScreenButton); |
| 751 visitor->trace(m_durationDisplay); | 752 visitor->trace(m_durationDisplay); |
| 752 visitor->trace(m_enclosure); | 753 visitor->trace(m_enclosure); |
| 753 visitor->trace(m_castButton); | 754 visitor->trace(m_castButton); |
| 754 visitor->trace(m_overlayCastButton); | 755 visitor->trace(m_overlayCastButton); |
| 755 HTMLDivElement::trace(visitor); | 756 HTMLDivElement::trace(visitor); |
| 756 } | 757 } |
| 757 | 758 |
| 758 } // namespace blink | 759 } // namespace blink |
| OLD | NEW |