Linking to an audio clip is quite similar to linking to an external graphics file, or another web page. In this method, we make use of the Anchor tag <A< to an audio file.
Syntax<A Href="URL ofaudiofile">link text</A>
Example<A Href="audio_1.mp3">Click</A>
We can make use of an image also in place of the linked text.
Example<A Href="audio_1.mp3"><Img Src="img1.jpg"></A>
When the user clicks on the linked text or image, the browser retrieves the audio file from the server and launches a helper application or plug-in to play the file, such as Real Player.
If the browser uses an external player, a new small window from the helper application opens with the controls for playing the audio.
| <HTML> <BODY Bgcolor="Pink"> <PRE> <CENTER> <H1>Using Anchor tag to link to an audio file <BR> <A Href="audio_1.mp3">Click heretoplaytheaudio</A> </CENTER> </PRE> </BODY> </HTML> |
We can insert video files in our HTML pages by using the same method as used for inserting the audio files. The supported file formats include:.mp4, .webm, .ogg, etc. Let us see how we can add video in our webpage:
A video file is linked to an HTML document in the same way as an audio file is linked i.e., using the <A>
Syntax:<A Href="URL of video file">link text</A>
Example:<A Href=" ideo_1.mp4">click<A>
| <HTML> <BODY Bgcolor="Pink"> <PRE> <CENTER> <H1>Using Anchor tag to link to an video file <BR> <A Href="audio_1.mp4">Click here to play the video</A> </CENTER> </PRE> </BODY> </HTML> |