Quantcast
Channel: Foren
Viewing all articles
Browse latest Browse all 170

Brand new tag in HTML5

$
0
0

The <video> tag in HTML5 is creative solution to embed or show vieo contents in a webpage. This <video> tag outdates the use of plug-ins such as flash player for showingup video. Let me explain some brief

To simply show a video

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

a full code with play/pause control

<!DOCTYPE html>
<html>
<body>

<div style="text-align:center">
  <button onclick="playPause()">Play/Pause</button>
    <br>
  <video id="video1" width="420">
    <source src="pon_movie.mp4" type="video/mp4">
    <source src="pon_movie.ogg" type="video/ogg">
    Your browser does not support HTML5 video.
  </video>
</div>

<script>
var myVideo=document.getElementById("video1");

function playPause()
{
if (myVideo.paused)
  myVideo.play();
else
  myVideo.pause();
}

</script>
</body>
</html>


Viewing all articles
Browse latest Browse all 170

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>