How to include the audio/video controls in HTML?


Use the controls attribute in HTML to include audio/ video controls in HTML.

Example

You can try to run the following code to implement the controls attribute −

<!DOCTYPE html>
<html>
   <head>
      <title>HTML video Tag</title>
   </head>
   <body>
      <p>Online Compiler</p>
      <br />
      <video width = "500" height = "300" controls>
         <source src = "/html/compileonline.mp4" type = "video/mp4">
         This browser doesn't support video tag.
      </video>
   </body>
</html>

Updated on: 03-Mar-2020

354 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements