User Guide
Using a SMIL file 713
Using a SMIL file
To handle multiple streams for multiple bandwidths, the VideoPlayer class uses a helper class
(NCManager) that supports a subset of SMIL. SMIL is used identify the location of the video
stream, the layout (width and height) of the FLV file, and the source FLV files that correspond
to the different bandwidths. It can also be used to specify the bit rate and duration of the
FLV file.
The following example shows a SMIL file that streams multiple bandwidth FLV files from a
FCS using RTMP:
<smil>
<head>
<meta base="rtmp://myserver/mypgm/" >
<layout>
<root-layout width="240" height="180" >
</layout>
</head>
<body>
<switch>
<video src="myvideo_mdm.flv" system-bitrate="56000"
dur="3:00.1">
<video src="myvideo_isdn.flv" system-bitrate="128000"
dur="3:00.1">
<ref src="myvideo_cable.flv" dur="3:00.1"/>
</switch>
</body>
</smil>
The <head> tag may contain the <meta> and <layout> tags. The <meta> tag supports only
the
base attribute, which is used to specify the URL of the streaming video (RTMP from
a FCS).
The
<layout> tag supports only the root-layout element, which is used to set the height
and
width attributes, and, therefore, determines the size of the window in which the FLV file
is rendered. These attributes accept only pixel values, not percentages.
Within the body of the SMIL file, you can either include a single link to a FLV source file or,
if you’re streaming multiple files for multiple bandwidths from a FCS (as in the previous
example), you can use the
<switch> tag to list the source files.
The
video and ref tags within the <switch> tag are synonymous—they both can use the
src attribute to specify FLV files. Further, each can use the region, system-bitrate, and
dur attributes to specify the region, the minimum bandwidth required, and the duration of
the FLV file.
Within the
<body> tag, only one occurrence of either the <video>, <src>, or <switch> tags
is allowed.