SMIL makes it easy to include advertisements in your streaming presentation. You can lay out ad banners, supply ad URLs, and even specify the times when ads appear. This chapter provides examples of how you can use SMIL to include ads in your presentations. Before you start, you should have a thorough understanding of SMIL as described in Chapter 7.
With RealSystem G2, you can create ads in any format, whether graphics, video, audio, or animation. Using SMIL, you simply treat your ads the same way you treat your media clips. You lay out your presentation and time when each media and ad clip appears. Because a SMIL file lists separate URLs to each clip, your ads can be on any server, whether RealServer, a Web server, or an ad server. And because a SMIL file is a plain text file, you can dynamically generate it by any means to present different ads for each page visitor.
The following example creates a video region with an ad banner above it. When a user plays the presentation, the video plays uninterrupted while ads appear in the ad banner twice a minute. The video and ads are defined to play at the same time within a <par> group. Within that group, ads are nested within a <seq> group and each defined to stay onscreen for 30 seconds. Each ad links to a different HTML page that displays in the browser when the user clicks the ad graphic.
<smil>
<head>
<!--presentation with video clip and ad banner-->
<layout>
<root-layout width="330" height="330" background-color="black"/>
<region id="adbanner" top="5" left="5" width="320" height="72"/>
<region id="videoregion" top="85" left="5"width="320" height="240"/>
</layout>
</head>
<body>
<par>
<video src="newsvid.rm" region="videoregion"/>
<seq>
<!--Display new linked ad banner every 30 seconds-->
<a href="http://www.company.com/ads/offer1.htm" show="new">
<img src="ad1.gif" region="adbanner" end="30s"/></a>
<a href="http://www.company.com/ads/offer2.htm" show="new">
<img src="ad2.gif" region="adbanner" end="60s"/></a>
<a href="http://www.company.com/ads/offer3.htm" show="new">
<img src="ad3.gif" region="adbanner" end="90s"/></a>
<a href="http://www.company.com/ads/offer4.htm" show="new">
<img src="ad4.gif" region="adbanner" end="120s"/></a>
</seq>
</par>
</body>
</smil>
|
|
Additional Information |
|---|
| "Laying Out Multiple Clips" explains how to set up regions. SMIL hyperlinking is described in "Linking to Other Media". |
The following example inserts three ad videos into a long video called news.rm. The effect is like a televison program with commercial breaks. Each ad video links to an HTML page that displays in the browser when the user clicks the ad:
<smil>
<head>
<!--video clip with commercial breaks-->
<meta name="author" content="Jane Morales"/>
<meta name="title" content="Technology in the News"/>
<meta name="copyright" content="(c)1998 Jane Morales"/>
</head>
<body>
<seq>
<video src="news.rm" clip-end="8.5min"/>
<a href="http://www.company.com/ads/offer1.htm" show="new">
<video src="commercial1.rm"/></a>
<video src="news.rm" clip-begin="8.5min" clip-end="16.75min"/>
<a href="http://www.company.com/ads/offer2.htm" show="new">
<video src="commercial2.rm"/></a>
<video src="news.rm" clip-begin="16.75min" clip-end="24.5min"/>
<a href="http://www.company.com/ads/offer3.htm" show="new">
<video src="commercial3.rm"/></a>
<video src="news.rm" clip-begin="24.5min"/>
</seq>
</body>
</smil>
As shown above, the three ad clips and the main video clip, news.rm, are in a <seq> group. The news.rm video begins at its normal beginning and plays for 8.5 minutes. It then stops while the commercial1.rm ad plays. The news.rm clip then resumes where it left off, breaking at later intervals for commercial2.rm and commercial3.rm. Because no timing elements are specified for the ads, they play from their normal beginnings to normal ends and may be any length.
|
|
Additional Information |
|---|
| For more on clip timing, see "Setting Internal Clip Begin and End Times". SMIL hyperlinking is described in "Linking to Other Media". |
The following tips will help you create smoother transitions between media and ad clips:
|
|
Additional Information |
|---|
| "Laying Out Multiple Clips" explains how to set up regions. |