« Happy Mac | Main | Important Words in Quality Assurance »
December 13, 2004
Flash Video In a Database
Flash Video Kit can help you start your own Flash Video gallery in PHP.
Here is how one would use Dreamweaver and the Flash Video Kit in a database setting:
0. Encode FLVs with metadata via Squeeze (comes with)
1. Create HTML template with one instance of Flash Video using Dreamweaver
2. Modify Flash Video code:
- site- or root-relative URLs for FLV using PHP/MySQL
- database values for Height and Width of FLV
- site- or root-relative URLs for Progressive Player and Skin.
Example.
From this:
<!-- Begin Flash Video for Progressive download -->
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="320" height="240" id="FLVPlayer">
<param name="movie" value="FLVPlayer_Progressive.swf" />
<param name="salign" value="lt" />
<param name="quality" value="high" />
<param name="scale" value="noscale" />
<param name="FlashVars" value="&skinName=clearSkin_3&streamName=media/flv/filename&autoPlay=false&autoRewind=true" />
<embed src="FLVPlayer_Progressive.swf" flashvars="&skinName=clearSkin_3&streamName=media/flv/filename&autoPlay=false&autoRewind=true" quality="high" scale="noscale" width="320" height="240" name="FLVPlayer" salign="LT" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
<!-- saved from url=(0013)about:internet -->
<!-- End Flash Video for Progressive Download -->
To this:
<!-- Begin Flash Video for Progressive download -->
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="[PHP or Your Value]" height="[PHP or Your Value]" id="FLVPlayer">
<param name="movie" value="http://[url]/FLVPlayer_Progressive.swf" />
<param name="salign" value="lt" />
<param name="quality" value="high" />
<param name="scale" value="noscale" />
<param name="FlashVars" value="&skinName=http://[url]/clearSkin_3&streamName=http://[url]/media/flv/filename&autoPlay=false&autoRewind=true" />
<embed src="http://[url]/FLVPlayer_Progressive.swf" flashvars="&skinName=http://[url]/clearSkin_3&streamName=>b?http://[url]/media/flv/filename&autoPlay=false&autoRewind=true" quality="high" scale="noscale" width="[PHP or Your Value]" height="[PHP or Your Value]" name="FLVPlayer" salign="LT" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
<!-- saved from url=(0013)about:internet -->
<!-- End Flash Video for Progressive Download -->
3. Create your PHP template using modified Flash Video code.
4. The above will also work with root-relative links (such as /media/flv/filename)
This way, you only keep one instance of the Progressive SWF and Skin SWF. This type of template code will also work in your blog, asssuming that you have FTP permissions to your site or anywhere that you can post the Progressive Player SWF and Skin SWF (as well as your videos of course).
If your team is using Contribute, you could have your content contributors post the encoded FLVs and and associated page (based on the template above), but for now you'll have to modify the code to include their URL (and video dimensions if neccessary) with Dreamweaver once they save the page.
Posted by at December 13, 2004 11:29 AM