How to specify if and how the author thinks the audio/video should be loaded when the page loads in HTML?

HTMLWeb DevelopmentFront End Technology

You can try to run the following code to learn how to implement a preload attribute to allow the author to give a hint to the browser for the best user experience. Works for both <audio> and <video> tags −

Example

<!DOCTYPE HTML>
<html>
   <body>
      <video width="300" height = "200" preload = "none" controls>
         <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>
   </body>
</html>
raja
Published on 14-Mar-2018 10:11:33
Advertisements