Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(339)

Side by Side Diff: Source/core/html/MediaController.cpp

Issue 204803002: Make scrubbing a MediaControls-internal concept (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 547 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 558
559 bool MediaController::hasAudio() const 559 bool MediaController::hasAudio() const
560 { 560 {
561 for (size_t index = 0; index < m_mediaElements.size(); ++index) { 561 for (size_t index = 0; index < m_mediaElements.size(); ++index) {
562 if (m_mediaElements[index]->hasAudio()) 562 if (m_mediaElements[index]->hasAudio())
563 return true; 563 return true;
564 } 564 }
565 return false; 565 return false;
566 } 566 }
567 567
568 void MediaController::beginScrubbing()
569 {
570 for (size_t index = 0; index < m_mediaElements.size(); ++index)
571 m_mediaElements[index]->beginScrubbing();
572 if (m_playbackState == PLAYING)
573 m_clock->stop();
574 }
575
576 void MediaController::endScrubbing()
577 {
578 for (size_t index = 0; index < m_mediaElements.size(); ++index)
579 m_mediaElements[index]->endScrubbing();
580 if (m_playbackState == PLAYING)
581 m_clock->start();
582 }
583
584 bool MediaController::canPlay() const 568 bool MediaController::canPlay() const
585 { 569 {
586 if (m_paused) 570 if (m_paused)
587 return true; 571 return true;
588 572
589 for (size_t index = 0; index < m_mediaElements.size(); ++index) { 573 for (size_t index = 0; index < m_mediaElements.size(); ++index) {
590 if (!m_mediaElements[index]->canPlay()) 574 if (!m_mediaElements[index]->canPlay())
591 return false; 575 return false;
592 } 576 }
593 return true; 577 return true;
(...skipping 25 matching lines...) Expand all
619 { 603 {
620 double now = WTF::currentTime(); 604 double now = WTF::currentTime();
621 double timedelta = now - m_previousTimeupdateTime; 605 double timedelta = now - m_previousTimeupdateTime;
622 606
623 if (timedelta < maxTimeupdateEventFrequency) 607 if (timedelta < maxTimeupdateEventFrequency)
624 return; 608 return;
625 609
626 scheduleEvent(EventTypeNames::timeupdate); 610 scheduleEvent(EventTypeNames::timeupdate);
627 m_previousTimeupdateTime = now; 611 m_previousTimeupdateTime = now;
628 } 612 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698