html video code example

Example 1: html video image

<video controls poster="/images/w3html5.gif">
  <source src="movie.mp4" type="video/mp4">
  <source src="movie.ogg" type="video/ogg">
  Your browser does not support the video tag.
</video>

Example 2: how to add a video playing on a html page

<iframe width="420" height="315"
src="https://www.youtube.com/embed/tgbNymZ7vqY">
</iframe>

Example 3: video tag html

<!DOCTYPE html>
<html>
<body>

<h1>Video TITLE</h1>

<video width="320" height="240" controls>
  <source src="Video Link">
</video>

</body>
</html>

Example 4: html5 video player

<video width="320" height="240" controls>
  <source src="movie.mp4" type="video/mp4">
  <source src="movie.ogg" type="video/ogg">
Your browser does not support the video tag. <!-- Text to be shown incase browser doesnt support html5 -->
</video>

Example 5: html video tag

<video width="320" height="240" controls>
  <source src="movie.mp4" type="video/mp4">
  <source src="movie.ogg" type="video/ogg">
  Your browser does not support the video tag.
</video>

Example 6: HTML Video

<video width="320" height="240" controls autoplay muted>

  <source src="movie.mp4" type="video/mp4">

  <source src="movie.ogg" type="video/ogg">

Your browser does not support the video tag.

</video>

Tags: