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

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

Issue 2237503002: Reject play promises when the playback reaches the end. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
« no previous file with comments | « no previous file | no next file » | 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 2895 matching lines...) Expand 10 before | Expand all | Expand 10 after
2906 if (loop()) { 2906 if (loop()) {
2907 // then seek to the earliest possible position of the media resourc e and abort these steps. 2907 // then seek to the earliest possible position of the media resourc e and abort these steps.
2908 seek(0); 2908 seek(0);
2909 } else { 2909 } else {
2910 // If the media element has still ended playback, and the direction of playback is still 2910 // If the media element has still ended playback, and the direction of playback is still
2911 // forwards, and paused is false, 2911 // forwards, and paused is false,
2912 if (!m_paused) { 2912 if (!m_paused) {
2913 // changes paused to true and fires a simple event named pause a t the media element. 2913 // changes paused to true and fires a simple event named pause a t the media element.
2914 m_paused = true; 2914 m_paused = true;
2915 scheduleEvent(EventTypeNames::pause); 2915 scheduleEvent(EventTypeNames::pause);
2916 scheduleRejectPlayPromises(AbortError);
foolip 2016/08/18 20:16:17 Add a TODO to add event firing and rejection in th
mlamouri (slow - plz ping) 2016/08/19 09:26:29 It is bug 587871. Given that we never bundle promi
2916 } 2917 }
2917 // Queue a task to fire a simple event named ended at the media elem ent. 2918 // Queue a task to fire a simple event named ended at the media elem ent.
2918 scheduleEvent(EventTypeNames::ended); 2919 scheduleEvent(EventTypeNames::ended);
2919 } 2920 }
2920 } 2921 }
2921 updatePlayState(); 2922 updatePlayState();
2922 } 2923 }
2923 2924
2924 void HTMLMediaElement::durationChanged() 2925 void HTMLMediaElement::durationChanged()
2925 { 2926 {
(...skipping 1114 matching lines...) Expand 10 before | Expand all | Expand 10 after
4040 4041
4041 IntRect HTMLMediaElement::AutoplayHelperClientImpl::absoluteBoundingBoxRect() co nst 4042 IntRect HTMLMediaElement::AutoplayHelperClientImpl::absoluteBoundingBoxRect() co nst
4042 { 4043 {
4043 IntRect result; 4044 IntRect result;
4044 if (LayoutObject* object = m_element->layoutObject()) 4045 if (LayoutObject* object = m_element->layoutObject())
4045 result = object->absoluteBoundingBoxRect(); 4046 result = object->absoluteBoundingBoxRect();
4046 return result; 4047 return result;
4047 } 4048 }
4048 4049
4049 } // namespace blink 4050 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698