Use the onsuspend attribute in HTML to run the script when the loading of media data suspends, for example, when download completes. It can happen in any of the following situations −
When a download is paused When a download completes Media is suspended, etc.
The attribute can be used with the <video> and <audio> elements and works in all the modern web browsers such as Firefox, Chrome, Opera, Safari, etc.