video Element html css learning

<video> Element html css learning 

The <video> HTML element embeds a media player which supports video playback into the document. You can use <video> for audio content as well, but the <audio> element may provide a more appropriate user experience.


HTML Video Tags

Tag Description

<video> Defines a video or movie

<source> Defines multiple media resources for media elements, such as <video> and <audio>

<track> Defines text tracks in media players


Example:


<video width="330" height="250" controls>
  <source src="movie.mp4" type="video/mp4">
  <source src="movie.ogg" type="video/ogg">
</video>


Example:


<video width="330" height="250" autoplay muted>
  <source src="https://media.istockphoto.com/videos/korean-girl-in-a-gray-coat-and-cap-stands-the-street-in-spring-at-the-video-id1403437179" type="video/mp4">
</video>



Output:





HTML <video> Autoplay

To start a video automatically, use the autoplay attribute:


Example


<video width="330" height="250" autoplay>
  <source src="movie.mp4" type="video/mp4">
  <source src="movie.ogg" type="video/ogg">
</video>


Add muted after autoplay to let your video start playing automatically :


Example


<video width="320" height="240" autoplay muted>
  <source src="movie.mp4" type="video/mp4">
  <source src="movie.ogg" type="video/ogg">
</video>


Comments :

Post a Comment