shamangeorge wrote:
by setting currentTime manually one may fire the 'canplaythrough' event on the audio element.
This is indeed what will happen, and pausing will also trigger the pause
event, both of which make this technique unsuitable for use as a "stop" method. Moreover, setting the src
as suggested by zaki will make the player try to load the current page's URL as a media file (and fail) if autoplay
is enabled - setting src
to null
is not allowed; it will always be treated as a URL. Short of destroying the player object there seems to be no good way of providing a "stop" method, so I would suggest just dropping the dedicated stop button and providing pause and skip back buttons instead - a stop button wouldn't really add any functionality.