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

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

Issue 1827573004: Allow play/pause on default controls to clear media errors. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Disable MediaSource and MediaStream URLs. Created 4 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) 2011, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Apple Inc. All rights reserved.
3 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. 3 * Copyright (C) 2011, 2012 Google Inc. All rights 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 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 if (useNewUi) { 245 if (useNewUi) {
246 // Show everything that we might hide. 246 // Show everything that we might hide.
247 // If we don't have a duration, then mark it to be hidden. For the 247 // If we don't have a duration, then mark it to be hidden. For the
248 // old UI case, want / don't want is the same as show / hide since 248 // old UI case, want / don't want is the same as show / hide since
249 // it is never marked as not fitting. 249 // it is never marked as not fitting.
250 m_durationDisplay->setIsWanted(std::isfinite(duration)); 250 m_durationDisplay->setIsWanted(std::isfinite(duration));
251 m_currentTimeDisplay->setIsWanted(true); 251 m_currentTimeDisplay->setIsWanted(true);
252 m_timeline->setIsWanted(true); 252 m_timeline->setIsWanted(true);
253 } 253 }
254 254
255 // If the player has entered an error state, force it into the paused state.
256 if (mediaElement().error())
257 mediaElement().pause();
258
255 updatePlayState(); 259 updatePlayState();
256 260
257 updateCurrentTimeDisplay(); 261 updateCurrentTimeDisplay();
258 262
259 m_timeline->setDuration(duration); 263 m_timeline->setDuration(duration);
260 m_timeline->setPosition(mediaElement().currentTime()); 264 m_timeline->setPosition(mediaElement().currentTime());
261 265
262 updateVolume(); 266 updateVolume();
263 267
264 refreshClosedCaptionsButtonVisibility(); 268 refreshClosedCaptionsButtonVisibility();
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after
751 visitor->trace(m_toggleClosedCaptionsButton); 755 visitor->trace(m_toggleClosedCaptionsButton);
752 visitor->trace(m_fullScreenButton); 756 visitor->trace(m_fullScreenButton);
753 visitor->trace(m_durationDisplay); 757 visitor->trace(m_durationDisplay);
754 visitor->trace(m_enclosure); 758 visitor->trace(m_enclosure);
755 visitor->trace(m_castButton); 759 visitor->trace(m_castButton);
756 visitor->trace(m_overlayCastButton); 760 visitor->trace(m_overlayCastButton);
757 HTMLDivElement::trace(visitor); 761 HTMLDivElement::trace(visitor);
758 } 762 }
759 763
760 } // namespace blink 764 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698