Execute Script When Media Data Fetching is Stopped 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: 2020-03-03T07:00:28+05:30

341 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements