Page 52 - DCAP408_WEB_PROGRAMMING
P. 52
Web Programming
Notes </body>
</html>
Result: Your result window for the above code is shown below:
HTML Tutorial This is a link to a page on this website.
Google This is a link to a website on the World Wide Web.
Self Assessment
Fill in the blanks:
5. A tag is said to be a paired tag if the text is placed between a tag and its ………………… tag.
6. To display an image on a page, you need to use the ………………… attribute.
7. The …………………… points to the location where the image is stored.
8. The alt attribute is used to define an “…………………….. “ for an image.
2.4 Audio and Video
2.4.1 Using the <video> tag
Lest you think what we’re about to wade through is ultimately an exercise in futility, if there is
no agreed upon standard, consider this: Google is chomping at the bit to use the video tag for
YouTube.
In fact, there’s already a mockup of what YouTube would look like using only HTML 5. While
the company hasn’t announced a timeline to convert YouTube to use the HTML 5 <video> tag,
you can bet that when they do, a sizable chunk of the web will follow suit.
So how does video work? Well, are you ready? Here’s the code to embed a video in HTML 5:
<video src=”/myvideo.mp4"></video>
Well, ideally you would do something more like this (which is what the aforementioned YouTube
demo does):
<video width=”640" height=”360" src=”/demo/google_main.mp4?2" autobuffer>
<div class=”fallback”>
<p>You must have an HTML5 capable browser.</p>
</div>
</video>
There are also a number of useful attributes for the <video> tag, including auto-play controls, a
“poster” attribute that points to an image file to display before the video is loaded and a boolean
attribute for play/pause controls. The <video> tag also has a whole host of events you can hook
into with JavaScript, allowing you to play movies inside movies and set up complex user
interactions via mouse and keyboard events.
46 LOVELY PROFESSIONAL UNIVERSITY