Home | | Internet & World Wide Web HOW TO PROGRAM | | Internet Programming | | Web Programming | Adding Video with the img Element’s dynsrc Property

Chapter: Internet & World Wide Web HOW TO PROGRAM - Multimedia: Audio, Video, Speech Synthesis and Recognition

Study Material, Lecturing Notes, Assignment, Reference, Wiki description explanation, brief detail

Adding Video with the img Element’s dynsrc Property

Users can tremendously enhance the multimedia presentations by incorporating a variety of video formats into their Web pages.

Adding Video with the img Element’s dynsrc Property

 

Users can tremendously enhance the multimedia presentations by incorporating a variety of video formats into their Web pages. The img element (introduced in Chapter 4) incor-porates both images and videos in a Web page. The src property, shown previously, indi-cates that the source is an image. The dynsrc (i.e., dynamic source) property indicates that the source is a video clip. The dynsrc property may have other properties such as loop, which is similar to the bgsound loop property. The XHTML document of Fig. 33.2 demonstrates the img element and its dynsrc property.

 

    <?xml version = "1.0"?>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

          <!-- Fig. 33.2: Dynamicimg.html       -->    

          <!-- Demonstrating the img element’s dynsrc property -->    

    <html xmlns = "http://www.w3.org/1999/xhtml">

    <head>

      <title>An Embedded Video Using the dynsrc Property</title>

      <bgsound src =

                   "http://msdn.microsoft.com/downloads/sounds/carib.MID"

      loop = "-1"></bgsound>

      </head>

      <body>

      <h1>An Embedded Video Using the img element's

      dynsrc Property</h1>

      <h2>Car and Carribean Music</h2>

<table>

<tr><td><img      dynsrc = "car_hi.wmv"

start = "mouseover" width = "180"

height = "135" loop = "-1"

alt = "Car driving in circles" /></td>

<td>This     page will play the audio clip and video

in a    loop.<br />The video will not begin

playing until you move the mouse over the

video.<br />Press <strong>Stop</strong> to

stop   playing the sound and the video.</td>

      </tr>

      </table>

      </body>

</html>


Fig. 33.2       Playing a video with the img element’s dynsrc property

 

The img element in lines 21–24 uses the dynsrc property to load and display the video car_hi.wmv. Property start specifies when the video should start playing. There are two possible start events—fileopen indicates that the video should play as soon as it loads into the browser, and mouseover indicates that the video should play when users first position the mouse over the video.

 

 

Study Material, Lecturing Notes, Assignment, Reference, Wiki description explanation, brief detail


Copyright © 2018-2020 BrainKart.com; All Rights Reserved. Developed by Therithal info, Chennai.