ended’ Event Fires PrematurelyWarning: This test case causes Chrome Mac to become unresponsive. See Chromium Issue 30242.
The goal of the following form is to play short MP3s immediately one after another.
The current version of Chrome fires the ended event before the audio
actually stops playing, so clicking the “Play” button below should result in a degree of
overlapping audio (especially for short words). There is a workaround to this problem by keeping track of the time
that the audio begins and adding the duration to it for a “minimum next play time”, and then when the ended
event fires do a setTimeout for the difference between the current time
and the next play time. This workaround is enabled if the checkbox below is checked.
Upon playing, a table will be constructed below the form showing how prematurely the
ended event is fired before the audio actually stops.