PREREQUISITES:
a) you will need a suitable player.swf file to handle playing of your videos. The code below assumes you have uploaded the player.swf file to the root of your store.
b) you may also need a suitable skin.swf file to handle displaying of the video frame. Also located in the root of your store.
c) you will need to supply your flash video in .flv format, with whatever encoding or structuring your player.swf file is able to support. This movie file will also need to be placed in the root of your store. The example below expects the file to be named movie1.flv
Steps to make it display on your Zen Cart home page:
1. You will need to create the following file, containing the following contents:
/includes/templates/NAME_OF_YOUR_TEMPLATE_HERE/jscript/jscript_swfobject.php
(you may need to create the jscript folder if it doesn't already exist)
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
<script type="text/javascript"> var flashvars = {}; var params = {}; params.bgcolor = "#000000"; params.allowscriptaccess = "always"; flashvars.videoPath = "movie1.flv"; flashvars.skinPath = "skin.swf"; var stageW = 400; var stageH = 300; var attributes = {}; attributes.id = "flashcontent"; swfobject.embedSWF("player.swf", "flashcontent", stageW, stageH, "9.0.0", false, flashvars, params, attributes); </script> <div id="flashcontent"> <p>Alternate text goes here, for people who cannot play Flash</p> <p>This video requires a more recent version of the Adobe Flash Player to display. Please update your version of the <a href="http://www.adobe.com/go/getflashplayer">Adobe Flash Player</a>.</p> </div>
Details on how to customize things in more detail can be found at http://code.google.com/p/swfobject/w/list