10.07.2015 Views

Building the User Interface by Using HTML5: Text, Graphics ... - server

Building the User Interface by Using HTML5: Text, Graphics ... - server

Building the User Interface by Using HTML5: Text, Graphics ... - server

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Building</strong> <strong>the</strong> <strong>User</strong> <strong>Interface</strong> <strong>by</strong> <strong>Using</strong> <strong>HTML5</strong>: <strong>Text</strong>, <strong>Graphics</strong>, and Media | 47Video TestLICENSED PRODUCT NOT FOR RESALE3. Save your file as L2-video.html.4. Go to <strong>the</strong> W3C Markup Validation Service Web page at http://validator.w3.org.Upload L2-video.html and click Check to have <strong>the</strong> service check it. Fix any errorsreported <strong>by</strong> <strong>the</strong> checker that relate to missing tags or typos, if any.5. Open <strong>the</strong> HTML file in a Web browser. Does <strong>the</strong> video play automatically? Do <strong>the</strong>controls appear? You should open <strong>the</strong> L2-video.html file in a variety of Webbrowsers as a test.6. In your editing tool, delete <strong>the</strong> autoplay line and replace controls="controls"with simply controls.7. Save <strong>the</strong> file again and validate it. It should validate with no errors. That indicatesthat <strong>HTML5</strong> allows you to use a shorthand method of specifying <strong>the</strong> controls attribute.The same principle applies to <strong>the</strong> autoplay and loop attributes.8. Leave <strong>the</strong> editing tool and Web browser open if you’re continuing immediately to <strong>the</strong>next exercise.Understanding and <strong>Using</strong> Audio TagsThe <strong>HTML5</strong> audio element works much like <strong>the</strong> video element but for sound only. To use<strong>the</strong> audio element, include <strong>the</strong> tag and a path to <strong>the</strong> file on your hard drive or auniform resource locator (URL) that points to <strong>the</strong> audio file.CERTIFICATION READYWhat is <strong>the</strong> markup forusing <strong>the</strong> <strong>HTML5</strong> audioelement?2.3The audio element enables you to incorporate audio, such as music and o<strong>the</strong>r sounds,in HTML documents. You can include <strong>the</strong> same control-related attributes as <strong>the</strong> videoelement: autoplay, controls, and loop. <strong>the</strong> following example shows just <strong>the</strong>controls attribute included:TAKE NOTE*If you use <strong>the</strong> autoplay attribute so that <strong>the</strong> audio plays automatically when <strong>the</strong> Webpage loads, use a short clip such as a sound effect. Many Web visitors dislike automaticsound and prefer to have more control.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!