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

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

Issue 2725893002: Media Controls timeline: immediately update current time display (Closed)
Patch Set: Created 3 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
3 * Copyright (C) 2012 Google Inc. All rights reserved. 3 * Copyright (C) 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 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after
775 // attribute to be rounded to a value slightly higher than the duration. If 775 // attribute to be rounded to a value slightly higher than the duration. If
776 // this happens and scrubber is dragged near the max, seek to duration. 776 // this happens and scrubber is dragged near the max, seek to duration.
777 if (time > duration) 777 if (time > duration)
778 time = duration; 778 time = duration;
779 779
780 // FIXME: This will need to take the timeline offset into consideration 780 // FIXME: This will need to take the timeline offset into consideration
781 // once that concept is supported, see https://crbug.com/312699 781 // once that concept is supported, see https://crbug.com/312699
782 if (mediaElement().seekable()->contain(time)) 782 if (mediaElement().seekable()->contain(time))
783 mediaElement().setCurrentTime(time); 783 mediaElement().setCurrentTime(time);
784 784
785 LayoutSliderItem slider = LayoutSliderItem(toLayoutSlider(layoutObject())); 785 // Provide immediate feedback (without waiting for media to seek) to make it
786 if (!slider.isNull() && slider.inDragMode()) 786 // easier for user to seek to a precise time.
787 mediaControls().updateCurrentTimeDisplay(); 787 mediaControls().updateCurrentTimeDisplay();
788 } 788 }
789 789
790 bool MediaControlTimelineElement::willRespondToMouseClickEvents() { 790 bool MediaControlTimelineElement::willRespondToMouseClickEvents() {
791 return isConnected() && document().isActive(); 791 return isConnected() && document().isActive();
792 } 792 }
793 793
794 void MediaControlTimelineElement::setPosition(double currentTime) { 794 void MediaControlTimelineElement::setPosition(double currentTime) {
795 setValue(String::number(currentTime)); 795 setValue(String::number(currentTime));
796 796
797 if (LayoutObject* layoutObject = this->layoutObject()) 797 if (LayoutObject* layoutObject = this->layoutObject())
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
1053 MediaControlCurrentTimeDisplayElement* 1053 MediaControlCurrentTimeDisplayElement*
1054 MediaControlCurrentTimeDisplayElement::create(MediaControls& mediaControls) { 1054 MediaControlCurrentTimeDisplayElement::create(MediaControls& mediaControls) {
1055 MediaControlCurrentTimeDisplayElement* element = 1055 MediaControlCurrentTimeDisplayElement* element =
1056 new MediaControlCurrentTimeDisplayElement(mediaControls); 1056 new MediaControlCurrentTimeDisplayElement(mediaControls);
1057 element->setShadowPseudoId( 1057 element->setShadowPseudoId(
1058 AtomicString("-webkit-media-controls-current-time-display")); 1058 AtomicString("-webkit-media-controls-current-time-display"));
1059 return element; 1059 return element;
1060 } 1060 }
1061 1061
1062 } // namespace blink 1062 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698