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

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: check mediaControllerInterface().paused() 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
« no previous file with comments | « Source/core/html/MediaController.h ('k') | Source/core/html/MediaControllerInterface.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 578 matching lines...) Expand 10 before | Expand all | Expand 10 after
589 589
590 bool MediaController::hasAudio() const 590 bool MediaController::hasAudio() const
591 { 591 {
592 for (size_t index = 0; index < m_mediaElements.size(); ++index) { 592 for (size_t index = 0; index < m_mediaElements.size(); ++index) {
593 if (m_mediaElements[index]->hasAudio()) 593 if (m_mediaElements[index]->hasAudio())
594 return true; 594 return true;
595 } 595 }
596 return false; 596 return false;
597 } 597 }
598 598
599 void MediaController::beginScrubbing()
600 {
601 for (size_t index = 0; index < m_mediaElements.size(); ++index)
602 m_mediaElements[index]->beginScrubbing();
603 if (m_playbackState == PLAYING)
604 m_clock->stop();
605 }
606
607 void MediaController::endScrubbing()
608 {
609 for (size_t index = 0; index < m_mediaElements.size(); ++index)
610 m_mediaElements[index]->endScrubbing();
611 if (m_playbackState == PLAYING)
612 m_clock->start();
613 }
614
615 bool MediaController::canPlay() const 599 bool MediaController::canPlay() const
616 { 600 {
617 if (m_paused) 601 if (m_paused)
618 return true; 602 return true;
619 603
620 for (size_t index = 0; index < m_mediaElements.size(); ++index) { 604 for (size_t index = 0; index < m_mediaElements.size(); ++index) {
621 if (!m_mediaElements[index]->canPlay()) 605 if (!m_mediaElements[index]->canPlay())
622 return false; 606 return false;
623 } 607 }
624 return true; 608 return true;
(...skipping 25 matching lines...) Expand all
650 { 634 {
651 double now = WTF::currentTime(); 635 double now = WTF::currentTime();
652 double timedelta = now - m_previousTimeupdateTime; 636 double timedelta = now - m_previousTimeupdateTime;
653 637
654 if (timedelta < maxTimeupdateEventFrequency) 638 if (timedelta < maxTimeupdateEventFrequency)
655 return; 639 return;
656 640
657 scheduleEvent(EventTypeNames::timeupdate); 641 scheduleEvent(EventTypeNames::timeupdate);
658 m_previousTimeupdateTime = now; 642 m_previousTimeupdateTime = now;
659 } 643 }
OLDNEW
« no previous file with comments | « Source/core/html/MediaController.h ('k') | Source/core/html/MediaControllerInterface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698