Changeset 68181 in webkit
- Timestamp:
- Sep 23, 2010 12:37:09 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r68178 r68181 1 2010-09-23 Eric Carlson <eric.carlson@apple.com> 2 3 Reviewed by Simon Fraser 4 5 'seeking' event should always fire 6 https://bugs.webkit.org/show_bug.cgi?id=45694 7 8 * media/event-attributes-expected.txt: Update for changes. 9 1 10 2010-09-23 Andrew Wilson <atwilson@chromium.org> 2 11 -
trunk/LayoutTests/media/event-attributes-expected.txt
r63684 r68181 26 26 *** seeking 27 27 RUN(video.currentTime = 5.6) 28 EVENT(seeking) 28 29 EVENT(seeked) 29 30 -
trunk/WebCore/ChangeLog
r68180 r68181 1 2010-09-23 Eric Carlson <eric.carlson@apple.com> 2 3 Reviewed by Simon Fraser 4 5 'seeking' event should always fire 6 https://bugs.webkit.org/show_bug.cgi?id=45694 7 8 Update seek algorithm to match current spec. 9 10 * html/HTMLMediaElement.cpp: 11 (WebCore::HTMLMediaElement::setReadyState): Don't need to fire 'seeking' event here. 12 (WebCore::HTMLMediaElement::seek): Always fire 'seeking'. Update comments. 13 (WebCore::HTMLMediaElement::finishSeek): Update comments. 14 (WebCore::HTMLMediaElement::mediaPlayerTimeChanged): Ditto. 15 1 16 2010-09-23 Eric Uhrhane <ericu@chromium.org> 2 17 -
trunk/WebCore/html/HTMLMediaElement.cpp
r67619 r68181 964 964 965 965 if (m_seeking) { 966 // 4.8.10. 10, step 8966 // 4.8.10.9, step 11 967 967 if (wasPotentiallyPlaying && m_readyState < HAVE_FUTURE_DATA) 968 968 scheduleEvent(eventNames().waitingEvent); 969 969 970 // 4.8.10.10, step 9 971 if (m_readyState < HAVE_CURRENT_DATA) { 972 if (oldState >= HAVE_CURRENT_DATA) 973 scheduleEvent(eventNames().seekingEvent); 974 } else { 975 // 4.8.10.10 step 12 & 13. 970 // 4.8.10.10 step 14 & 15. 971 if (m_readyState >= HAVE_CURRENT_DATA) 976 972 finishSeek(); 977 }978 979 973 } else { 980 974 if (wasPotentiallyPlaying && m_readyState < HAVE_FUTURE_DATA) { 981 // 4.8.10. 9975 // 4.8.10.8 982 976 scheduleTimeupdateEvent(false); 983 977 scheduleEvent(eventNames().waitingEvent); … … 1102 1096 float now = currentTime(); 1103 1097 1098 // 2 - If the element's seeking IDL attribute is true, then another instance of this algorithm is 1099 // already running. Abort that other instance of the algorithm without waiting for the step that 1100 // it is running to complete. 1101 // Nothing specific to be done here. 1102 1104 1103 // 3 - Set the seeking IDL attribute to true. 1105 // The flag will be cleared when the engine tells is the time has actually changed1104 // The flag will be cleared when the engine tells us the time has actually changed. 1106 1105 m_seeking = true; 1107 1106 1108 // 4 - Queue a task to fire a simple event named timeupdate at the element. 1109 scheduleTimeupdateEvent(false); 1110 1111 // 6 - If the new playback position is later than the end of the media resource, then let it be the end 1107 // 5 - If the new playback position is later than the end of the media resource, then let it be the end 1112 1108 // of the media resource instead. 1113 1109 time = min(time, duration()); 1114 1110 1115 // 7- If the new playback position is less than the earliest possible position, let it be that position instead.1111 // 6 - If the new playback position is less than the earliest possible position, let it be that position instead. 1116 1112 float earliestTime = m_player->startTime(); 1117 1113 time = max(time, earliestTime); 1118 1114 1119 // 8- If the (possibly now changed) new playback position is not in one of the ranges given in the1115 // 7 - If the (possibly now changed) new playback position is not in one of the ranges given in the 1120 1116 // seekable attribute, then let it be the position in one of the ranges given in the seekable attribute 1121 1117 // that is the nearest to the new playback position. ... If there are no ranges given in the seekable 1122 1118 // attribute then set the seeking IDL attribute to false and abort these steps. 1123 1119 RefPtr<TimeRanges> seekableRanges = seekable(); 1124 if (!seekableRanges->length() || time == now) { 1120 1121 // Short circuit seeking to the current time by just firing the events if no seek is required. 1122 // Don't skip calling the media engine if we are in poster mode because a seek should always 1123 // cancel poster display. 1124 bool noSeekRequired = !seekableRanges->length() || (time == now && displayMode() != Poster); 1125 if (noSeekRequired) { 1126 if (time == now) { 1127 scheduleEvent(eventNames().seekingEvent); 1128 scheduleTimeupdateEvent(false); 1129 scheduleEvent(eventNames().seekedEvent); 1130 } 1125 1131 m_seeking = false; 1126 1132 return; … … 1135 1141 m_sentEndEvent = false; 1136 1142 1137 // 9- Set the current playback position to the given new playback position1143 // 8 - Set the current playback position to the given new playback position 1138 1144 m_player->seek(time); 1139 1145 1140 // 10-15 are handled, if necessary, when the engine signals a readystate change. 1146 // 9 - Queue a task to fire a simple event named seeking at the element. 1147 scheduleEvent(eventNames().seekingEvent); 1148 1149 // 10 - Queue a task to fire a simple event named timeupdate at the element. 1150 scheduleTimeupdateEvent(false); 1151 1152 // 11-15 are handled, if necessary, when the engine signals a readystate change. 1141 1153 } 1142 1154 … … 1145 1157 LOG(Media, "HTMLMediaElement::finishSeek"); 1146 1158 1147 // 4.8.10. 10 Seeking step 121159 // 4.8.10.9 Seeking step 14 1148 1160 m_seeking = false; 1149 1161 1150 // 4.8.10. 10 Seeking step 131162 // 4.8.10.9 Seeking step 15 1151 1163 scheduleEvent(eventNames().seekedEvent); 1152 1164 … … 1661 1673 scheduleTimeupdateEvent(false); 1662 1674 1663 // 4.8.10. 10 step 12 & 13. Needed if no ReadyState change is associated with the seek.1664 if (m_ readyState >= HAVE_CURRENT_DATA && m_seeking)1675 // 4.8.10.9 step 14 & 15. Needed if no ReadyState change is associated with the seek. 1676 if (m_seeking && m_readyState >= HAVE_CURRENT_DATA) 1665 1677 finishSeek(); 1666 1678
Note: See TracChangeset
for help on using the changeset viewer.