To dynamically add new videos to your playlist, you simply edit the playlist-demo-1.xml file, which is included in the ZIP file for this tutorial. Thumbnail filenames need to be specified in this file as well. The last attribute of each item is thumb; its value is the thumbnail filename, as shown in the following code:
<xml>
<listitem name="Battle 1" url="streams" thumb="battle1.jpg">
<stream name="battle1.flv" />
</listitem>
<listitem name="Fight!!!" url="streams" thumb="fight.jpg">
<stream name="fight.flv" />
</listitem>
<listitem name="Marco Diaper" url="streams" thumb="marcodiaper.jpg">
<stream name="marcodiaper.flv" />
</listitem>
<listitem name="Cheetah Cougar" url="streams" thumb="cheetahcougar.jpg">
<stream name="cheetahcougar.flv" />
</listitem>
<listitem name="Cloning" url="streams" thumb="cloning.jpg">
<stream name="cloning.flv" />
</listitem>
<listitem name="Run" url="streams" thumb="run.jpg">
<stream name="run.flv" />
</listitem>
<listitem name="Midgets 1" url="streams" thumb="midgets1.jpg">
<stream name="midgets1.flv" />
</listitem>
<listitem name="Midgets 2" url="streams" thumb="midgets2.jpg">
<stream name="midgets2.flv" />
</listitem>
<menu>
<listitem name="Battle 1"/>
<listitem name="Fight!!!"/>
<listitem name="Marco Diaper"/>
<listitem name="Cheetah Cougar"/>
<listitem name="Cloning"/>
<listitem name="Run"/>
<listitem name="Midgets 1"/>
<listitem name="Midgets 2"/>
</menu>
</xml>
To display the thumbnails in the playlist, you’ll now edit the VideoThumb.as file to grab them.




December 31, 2009
How To