Execute a script when fetching the media data is stopped before it is completely loaded in HTML?


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.

Updated on: 03-Mar-2020

254 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements