Even when browser doesnt provide the required support
440 | CHAPTER 14 |
|
|
---|---|---|---|
TIP | As an alternative to the <asp:Image> tag, you can always use the <img> tag to reduce application |
complexity and server load. The use of an <img> tag points to the success of the animated GIF. Even when a browser doesn’t provide the required support, which is rare, the use of this standard tag lets the user see the first frame of the animated GIF, so the Web page doesn’t look bare. Consequently, always make the first frame of your animated GIF something that can stand alone so the user sees some-thing useful even when the animation isn’t available. The <img> tag has one advantage over the <asp:Image> tag. Sometimes you don’t want the animated GIF to run continuously. You can add the loop attribute to the <img> tag to let the image animate for a set number of times and then stop.
WORKING WITH MEDIA | 441 |
---|
Audio
The next most popular media addition to Web sites (after animated GIFs) is audio. Some people actu-ally play whole symphonies in the background, but that’s the exception rather than the rule. In this case, you have three tags to choose from for adding audio to your Web page, and you could possibly add other techniques. Listing 14.13 shows the various techniques. You’ll find this example in the \ABC_Inc\Media folder of the source code on the Sybex Web site.
Listing 14.13: |
|
---|
<asp:Label ID="lblAudio" runat="server"
<embed id="embedAudio" src="../Images/tada.wav" loop="1"
title="This sound file makes the Tada sound, which is often
NavigateUrl="~/Images/tada.wav"
ToolTip="This sound file makes the Tada sound, which is