HTML onsuspend Event Attribute

Description

The event attribute onsuspend occurs when the receipt of media file data is terminated before the end of the full download for any reason.

This event occurs when media reception is paused. This can happen when the download is complete, or because it has been paused for some reason.

Events that occur when there are any violations in the process of downloading multimedia data include:

Syntax

<element onsuspend="script">

Values

  • scriptThe name of the script to use when the event has been triggered.

Example

<!DOCTYPE html>
<html>
<body>
<video controls onsuspend="myFunction()">
  <source src="sample.mp4" type="video/mp4">
  Your browser does not support HTML5 video.
</video>

<script>
function myFunction() {
    alert("Media loading suspended");
}
</script>

</body>
</html>

Supported Tags

<audio> and <video>

Browser Support

Desktop
Explorer Edge Chrome Firefox Opera Safari
XXYes3.6XX
Tablets / Mobile
Android Chrome Firefox Opera Safari Samsung
YesYes4XXX