Internet Explorer is the only browser that supports the DYNSRC attribute of the <IMG> tag. DYNSRC can be used to point to an actual video file. This technique works only with AVI files and is not nearly as flexible as the OBJECT element technique (which we will examine later). It is quite easy to use, however, and effective for simple jobs. Listing 18-2 demonstrates the use of this type of <IMG> tag. Figure 18-1 shows the results.
Code Listing 18-2.
<HTML> <HEAD> <TITLE>Listing 18-2</TITLE> </HEAD> <BODY> <IMG DYNSRC="clouds.avi"> </BODY> </HTML> |
Figure 18-1. An <IMG> tag that uses the DYNSRC attribute.
The DYNSRC attribute functions exactly like the SRC attribute, but it is used to point to a video instead of a standard graphic file. Like the <BGSOUND> tag, <IMG> supports the LOOP attribute, which specifies the number of times the video should be repeated. A value of infinite or -1 will repeat the movie perpetually.
IMG elements provide only minimal support for audio and video. Internet Explorer 4 and later support the Media Player control, which is scriptable and gives far greater control over your media.