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

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

Issue 219523004: Let MediaController.currentTime return the position previously set (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 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 | « LayoutTests/media/media-controller-playback-expected.txt ('k') | no next file » | 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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 // When the user agent is to seek the media controller to a particular new p layback position, 163 // When the user agent is to seek the media controller to a particular new p layback position,
164 // it must follow these steps: 164 // it must follow these steps:
165 // If the new playback position is less than zero, then set it to zero. 165 // If the new playback position is less than zero, then set it to zero.
166 time = max(0.0, time); 166 time = max(0.0, time);
167 167
168 // If the new playback position is greater than the media controller duratio n, then set it 168 // If the new playback position is greater than the media controller duratio n, then set it
169 // to the media controller duration. 169 // to the media controller duration.
170 time = min(time, duration()); 170 time = min(time, duration());
171 171
172 // Set the media controller position to the new playback position. 172 // Set the media controller position to the new playback position.
173 m_position = time;
173 m_clock->setCurrentTime(time); 174 m_clock->setCurrentTime(time);
174 175
175 // Seek each slaved media element to the new playback position relative to t he media element timeline. 176 // Seek each slaved media element to the new playback position relative to t he media element timeline.
176 for (size_t index = 0; index < m_mediaElements.size(); ++index) 177 for (size_t index = 0; index < m_mediaElements.size(); ++index)
177 m_mediaElements[index]->seek(time, exceptionState); 178 m_mediaElements[index]->seek(time, exceptionState);
178 179
179 scheduleTimeupdateEvent(); 180 scheduleTimeupdateEvent();
180 } 181 }
181 182
182 void MediaController::unpause() 183 void MediaController::unpause()
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after
613 { 614 {
614 double now = WTF::currentTime(); 615 double now = WTF::currentTime();
615 double timedelta = now - m_previousTimeupdateTime; 616 double timedelta = now - m_previousTimeupdateTime;
616 617
617 if (timedelta < maxTimeupdateEventFrequency) 618 if (timedelta < maxTimeupdateEventFrequency)
618 return; 619 return;
619 620
620 scheduleEvent(EventTypeNames::timeupdate); 621 scheduleEvent(EventTypeNames::timeupdate);
621 m_previousTimeupdateTime = now; 622 m_previousTimeupdateTime = now;
622 } 623 }
OLDNEW
« no previous file with comments | « LayoutTests/media/media-controller-playback-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698