Page 152 - CA_165_V2.0_Flipbook
P. 152

Inserting Sound using <AUDIO> Tag


                  The <AUDIO> element enables to embed audio in web pages. Syntax to use the <AUDIO> tag is as
                  follows:
                    <AUDIO CONTROLS>

                    <SOURCE SRC="Name of the Audio File" TYPE="AUDIO/WAV">

                    </AUDIO>
                                                             <AUDIO> Tag
                        Type          Function            Attributes            Contains            Used Inside

                   Container tag   Embeds audio      SRC, CONTROLS,         Optional fallback   Typically placed within
                                   content in a      AUTOPLAY, AND          content if the      <BODY> or other
                                   document.         LOOP.                  audio is not        container tags.
                                                                            supported.
                  The following HTML code uses the <AUDIO> tag to insert audio with controls for playing, pausing,

                  <HTML>
                  <HEAD>

                  <TITLE>
                  INSERTING SOUND USING <AUDIO> TAG
                  </TITLE>

                  <BODY>
                  <AUDIO CONTROLS>
                  <SOURCE SRC="SOUND.MP3" TYPE="AUDIO/MP3">
                  </AUDIO>

                  </BODY>
                  </HTML>
                  The output of the preceding HTML code is as follows:







                         Audio Player to
                          Play MP3 File





                  Inserting Video using <VIDEO> Tag

                  The <VIDEO> element enables to attach video in the web page. Syntax to use the <VIDEO> tag is as
                  follows:

                    <VIDEO WIDTH="500" HEIGHT="300" CONTROLS>

                    <SOURCE SRC="orange.mp4" TYPE="video/mp4">
                    </VIDEO>

                   150   Touchpad Computer Applications-X
   147   148   149   150   151   152   153   154   155   156   157