Created attachment 263535 [details]
Sample HTML page with an externally-linked audio file to demonstrate the bug
The Media "ended" event appears to fire incorrectly when the currentTime property is altered after the media has ended playback. When that happens, the event does not fire properly again until after the playback ends a second time. I attached a sample HTML file to demonstrate the issue.
Steps to reproduce:
1. On a page that has a video/audio element, attach an "ended" event listener
2. In the event handler, alert a message
3. In the event handler, sets the currentTime property to 0
4. Play the video/audio until it ends
5. Play the video/audio a second time until it ends
The message should be alerted only once every time the playback ends.
The message gets alerted twice at the end of the first playback. The message does not get alerted at all at the end of the second playback.
Safari 8.0.8 on OS X 10.10.5 -- NOT affected
Safari 9.0 on OS X 10.10.5 -- affected
Safari 9.0 on OS X 10.11 -- affected
WebKit r191315 on OS X 10.10.5 -- affected
MobileSafari on iOS 8.4.1 -- NOT affected
MobileSafari on iOS 9.0.2 -- affected
Created attachment 269751 [details]
Comment on attachment 269751 [details]
Clearing flags on attachment: 269751
Committed r195540: <http://trac.webkit.org/changeset/195540>
All reviewed patches have been landed. Closing bug.