Following is the syntax - Example You can try running the following code to implement the onstalled attribute - < !DOCTYPEHTML>"/> Following is the syntax - Example You can try running the following code to implement the onstalled attribute - < !DOCTYPEHTML>">

Home  >  Article  >  Web Front-end  >  Execute script in HTML when browser cannot get media data for any reason?

Execute script in HTML when browser cannot get media data for any reason?

王林
王林forward
2023-08-30 11:05:06764browse

Execute script in HTML when browser cannot get media data for any reason?

Use the onstalled attribute in HTML to execute the script when the browser cannot get the media date. The

onstalled attribute can be used on the following elements -
<video>
<audio>
The following is the syntax for

-

<video onstalled ="script">

The following is the syntax for

-

<audio onstalled = "script">

Example

You can try running the following code to achieve

onstalled Properties-

<!DOCTYPE HTML>
<html>
   <body>
      <video width = "300" height = "200" controls onstalled ="display()">
         <source src = "/html5/foo.ogg" type = "video/ogg" />
         <source src = "/html5/foo.mp4" type = "video/mp4" />
         Your browser does not support the video element.
      </video>
      <script>
         function display()
         {
            alert ("Sorry! Video isn&#39;t available right now!");
         }
      </script>
   </body>
</html>

The above is the detailed content of Execute script in HTML when browser cannot get media data for any reason?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete