Page 104 - ClickGPT V4.0 C-5
P. 104

ADDING AUDIO & VIDEO


              The HTML5 <audio> and <video> tags allow us to add media (audio and video) to a website. To add
              media, we are required to set src attribute to identify the media source and include the "controls"
              attribute to allow users to play, pause and control the media:
                   Autoplay Attribute: The "Autoplay" attribute is a boolean attribute that plays the video automatically
                  as soon as the page loads

                  Controls Attribute: The "control" attribute allows users to gain control over how the video is played.

              Adding Audio

              We use <audio> tag to embed sound content in an HTML document.

              <!DOCTYPE HTML>

              <HTML>
              <HEAD>
              <TITLE>Audio</TITLE>
              </HEAD>

              <BODY>
                <H1 STYLE="TEXT-ALIGN: center; COLOR: red;">Welcome to the Musical World</H1>
              <P STYLE="TEXT-ALIGN: center;">
              <BR>
              <IMG SRC="MusicalNote.jpg">

              </P>
                <AUDIO SRC="Flute.mp3" CONTROLS AUTOPLAY>
                </AUDIO>
              </BODY>

              </HTML>
              Adding Video

              We use <video> tag to embed video in an HTML document.

              <!DOCTYPE HTML>
              <HTML>
              <HEAD>
                <TITLE>Video</TITLE>
              </HEAD>
              <BODY>
              <H1     STYLE="TEXT-ALIGN:          center;      COLOR:
              red;">Welcome to the World of Movies</H1>
                <P STYLE="TEXT-ALIGN: center;">
              <IMG SRC="VideoLogo.png" WIDTH="100"
              HEIGHT="100">
                </P>



                        Premium Edition-V
                102
   99   100   101   102   103   104   105   106   107   108   109