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

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: 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) 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 2081 matching lines...) Expand 10 before | Expand all | Expand 10 after
2092 m_muted = muted; 2092 m_muted = muted;
2093 2093
2094 updateVolume(); 2094 updateVolume();
2095 2095
2096 if (hasMediaControls()) 2096 if (hasMediaControls())
2097 mediaControls()->changedMute(); 2097 mediaControls()->changedMute();
2098 2098
2099 scheduleEvent(EventTypeNames::volumechange); 2099 scheduleEvent(EventTypeNames::volumechange);
2100 } 2100 }
2101 2101
2102 void HTMLMediaElement::beginScrubbing()
2103 {
2104 WTF_LOG(Media, "HTMLMediaElement::beginScrubbing - paused() is %s", boolStri ng(paused()));
2105
2106 if (!paused()) {
2107 if (ended()) {
2108 // Because a media element stays in non-paused state when it reaches end, playback resumes
2109 // when the slider is dragged from the end to another position unles s we pause first. Do
2110 // a "hard pause" so an event is generated, since we want to stay pa used after scrubbing finishes.
2111 pause();
2112 } else {
2113 // Not at the end but we still want to pause playback so the media e ngine doesn't try to
2114 // continue playing during scrubbing. Pause without generating an ev ent as we will
2115 // unpause after scrubbing finishes.
2116 setPausedInternal(true);
2117 }
2118 }
2119 }
2120
2121 void HTMLMediaElement::endScrubbing()
2122 {
2123 WTF_LOG(Media, "HTMLMediaElement::endScrubbing - m_pausedInternal is %s", bo olString(m_pausedInternal));
2124
2125 if (m_pausedInternal)
2126 setPausedInternal(false);
2127 }
2128
2129 // The spec says to fire periodic timeupdate events (those sent while playing) e very 2102 // The spec says to fire periodic timeupdate events (those sent while playing) e very
2130 // "15 to 250ms", we choose the slowest frequency 2103 // "15 to 250ms", we choose the slowest frequency
2131 static const double maxTimeupdateEventFrequency = 0.25; 2104 static const double maxTimeupdateEventFrequency = 0.25;
2132 2105
2133 void HTMLMediaElement::startPlaybackProgressTimer() 2106 void HTMLMediaElement::startPlaybackProgressTimer()
2134 { 2107 {
2135 if (m_playbackProgressTimer.isActive()) 2108 if (m_playbackProgressTimer.isActive())
2136 return; 2109 return;
2137 2110
2138 m_previousProgressTime = WTF::currentTime(); 2111 m_previousProgressTime = WTF::currentTime();
(...skipping 1479 matching lines...) Expand 10 before | Expand all | Expand 10 after
3618 { 3591 {
3619 m_mediaSource->setWebMediaSourceAndOpen(adoptPtr(webMediaSource)); 3592 m_mediaSource->setWebMediaSourceAndOpen(adoptPtr(webMediaSource));
3620 } 3593 }
3621 3594
3622 bool HTMLMediaElement::isInteractiveContent() const 3595 bool HTMLMediaElement::isInteractiveContent() const
3623 { 3596 {
3624 return fastHasAttribute(controlsAttr); 3597 return fastHasAttribute(controlsAttr);
3625 } 3598 }
3626 3599
3627 } 3600 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698