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

Side by Side Diff: Source/core/html/HTMLMediaElement.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/HTMLMediaElement.h ('k') | Source/core/html/MediaController.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) 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 2114 matching lines...) Expand 10 before | Expand all | Expand 10 after
2125 m_muted = muted; 2125 m_muted = muted;
2126 2126
2127 updateVolume(); 2127 updateVolume();
2128 2128
2129 if (hasMediaControls()) 2129 if (hasMediaControls())
2130 mediaControls()->changedMute(); 2130 mediaControls()->changedMute();
2131 2131
2132 scheduleEvent(EventTypeNames::volumechange); 2132 scheduleEvent(EventTypeNames::volumechange);
2133 } 2133 }
2134 2134
2135 void HTMLMediaElement::beginScrubbing()
2136 {
2137 WTF_LOG(Media, "HTMLMediaElement::beginScrubbing - paused() is %s", boolStri ng(paused()));
2138
2139 if (!paused()) {
2140 if (ended()) {
2141 // Because a media element stays in non-paused state when it reaches end, playback resumes
2142 // when the slider is dragged from the end to another position unles s we pause first. Do
2143 // a "hard pause" so an event is generated, since we want to stay pa used after scrubbing finishes.
2144 pause();
2145 } else {
2146 // Not at the end but we still want to pause playback so the media e ngine doesn't try to
2147 // continue playing during scrubbing. Pause without generating an ev ent as we will
2148 // unpause after scrubbing finishes.
2149 setPausedInternal(true);
2150 }
2151 }
2152 }
2153
2154 void HTMLMediaElement::endScrubbing()
2155 {
2156 WTF_LOG(Media, "HTMLMediaElement::endScrubbing - m_pausedInternal is %s", bo olString(m_pausedInternal));
2157
2158 if (m_pausedInternal)
2159 setPausedInternal(false);
2160 }
2161
2162 // The spec says to fire periodic timeupdate events (those sent while playing) e very 2135 // The spec says to fire periodic timeupdate events (those sent while playing) e very
2163 // "15 to 250ms", we choose the slowest frequency 2136 // "15 to 250ms", we choose the slowest frequency
2164 static const double maxTimeupdateEventFrequency = 0.25; 2137 static const double maxTimeupdateEventFrequency = 0.25;
2165 2138
2166 void HTMLMediaElement::startPlaybackProgressTimer() 2139 void HTMLMediaElement::startPlaybackProgressTimer()
2167 { 2140 {
2168 if (m_playbackProgressTimer.isActive()) 2141 if (m_playbackProgressTimer.isActive())
2169 return; 2142 return;
2170 2143
2171 m_previousProgressTime = WTF::currentTime(); 2144 m_previousProgressTime = WTF::currentTime();
(...skipping 1514 matching lines...) Expand 10 before | Expand all | Expand 10 after
3686 { 3659 {
3687 m_mediaSource->setWebMediaSourceAndOpen(adoptPtr(webMediaSource)); 3660 m_mediaSource->setWebMediaSourceAndOpen(adoptPtr(webMediaSource));
3688 } 3661 }
3689 3662
3690 bool HTMLMediaElement::isInteractiveContent() const 3663 bool HTMLMediaElement::isInteractiveContent() const
3691 { 3664 {
3692 return fastHasAttribute(controlsAttr); 3665 return fastHasAttribute(controlsAttr);
3693 } 3666 }
3694 3667
3695 } 3668 }
OLDNEW
« no previous file with comments | « Source/core/html/HTMLMediaElement.h ('k') | Source/core/html/MediaController.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698