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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLMediaElement.cpp

Issue 2689323002: Media: Delete Pause-To-Buffer. (Closed)
Patch Set: Rebase. Created 3 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights
3 * reserved. 3 * reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 2296 matching lines...) Expand 10 before | Expand all | Expand 10 after
2307 } 2307 }
2308 2308
2309 playInternal(); 2309 playInternal();
2310 2310
2311 return nullptr; 2311 return nullptr;
2312 } 2312 }
2313 2313
2314 void HTMLMediaElement::playInternal() { 2314 void HTMLMediaElement::playInternal() {
2315 BLINK_MEDIA_LOG << "playInternal(" << (void*)this << ")"; 2315 BLINK_MEDIA_LOG << "playInternal(" << (void*)this << ")";
2316 2316
2317 // Always return the buffering strategy to normal when not paused,
2318 // regardless of the cause. (In contrast with aggressive buffering which is
2319 // only enabled by pause(), not pauseInternal().)
2320 if (webMediaPlayer())
2321 webMediaPlayer()->setBufferingStrategy(
2322 WebMediaPlayer::BufferingStrategy::Normal);
2323
2324 // 4.8.12.8. Playing the media resource 2317 // 4.8.12.8. Playing the media resource
2325 if (m_networkState == kNetworkEmpty) 2318 if (m_networkState == kNetworkEmpty)
2326 invokeResourceSelectionAlgorithm(); 2319 invokeResourceSelectionAlgorithm();
2327 2320
2328 // Generally "ended" and "looping" are exclusive. Here, the loop attribute 2321 // Generally "ended" and "looping" are exclusive. Here, the loop attribute
2329 // is ignored to seek back to start in case loop was set after playback 2322 // is ignored to seek back to start in case loop was set after playback
2330 // ended. See http://crbug.com/364442 2323 // ended. See http://crbug.com/364442
2331 if (endedPlayback(LoopCondition::Ignored)) 2324 if (endedPlayback(LoopCondition::Ignored))
2332 seek(0); 2325 seek(0);
2333 2326
(...skipping 11 matching lines...) Expand all
2345 2338
2346 m_canAutoplay = false; 2339 m_canAutoplay = false;
2347 2340
2348 setIgnorePreloadNone(); 2341 setIgnorePreloadNone();
2349 updatePlayState(); 2342 updatePlayState();
2350 } 2343 }
2351 2344
2352 void HTMLMediaElement::pause() { 2345 void HTMLMediaElement::pause() {
2353 BLINK_MEDIA_LOG << "pause(" << (void*)this << ")"; 2346 BLINK_MEDIA_LOG << "pause(" << (void*)this << ")";
2354 2347
2355 // Only buffer aggressively on a user-initiated pause. Other types of pauses
2356 // (which go directly to pauseInternal()) should not cause this behavior.
2357 if (webMediaPlayer() && UserGestureIndicator::utilizeUserGesture())
2358 webMediaPlayer()->setBufferingStrategy(
2359 WebMediaPlayer::BufferingStrategy::Aggressive);
2360
2361 if (m_autoplayVisibilityObserver) { 2348 if (m_autoplayVisibilityObserver) {
2362 m_autoplayVisibilityObserver->stop(); 2349 m_autoplayVisibilityObserver->stop();
2363 m_autoplayVisibilityObserver = nullptr; 2350 m_autoplayVisibilityObserver = nullptr;
2364 } 2351 }
2365 2352
2366 pauseInternal(); 2353 pauseInternal();
2367 } 2354 }
2368 2355
2369 void HTMLMediaElement::pauseInternal() { 2356 void HTMLMediaElement::pauseInternal() {
2370 BLINK_MEDIA_LOG << "pauseInternal(" << (void*)this << ")"; 2357 BLINK_MEDIA_LOG << "pauseInternal(" << (void*)this << ")";
(...skipping 1870 matching lines...) Expand 10 before | Expand all | Expand 10 after
4241 kMostlyFillViewportBecomeStableSeconds, BLINK_FROM_HERE); 4228 kMostlyFillViewportBecomeStableSeconds, BLINK_FROM_HERE);
4242 } 4229 }
4243 4230
4244 void HTMLMediaElement::viewportFillDebouncerTimerFired(TimerBase*) { 4231 void HTMLMediaElement::viewportFillDebouncerTimerFired(TimerBase*) {
4245 m_mostlyFillingViewport = true; 4232 m_mostlyFillingViewport = true;
4246 if (m_webMediaPlayer) 4233 if (m_webMediaPlayer)
4247 m_webMediaPlayer->becameDominantVisibleContent(m_mostlyFillingViewport); 4234 m_webMediaPlayer->becameDominantVisibleContent(m_mostlyFillingViewport);
4248 } 4235 }
4249 4236
4250 } // namespace blink 4237 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLMediaElement.h ('k') | third_party/WebKit/Source/core/html/HTMLVideoElementTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698