Displaying a Flash video on the home page.

NOTE: Flash video on webpages is becoming more and more outdated, in favor of newer and more widely-accepted technologies.

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)
Code:
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
2. In your /includes/languages/english/html_includes/NAME_OF_YOUR_TEMPLATE_HERE/define_main_page.php, add the following HTML:
Code:
<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>
It is best to paste this code in "plain text" mode, and NOT in a rich-text/wysiwyg editor mode.

Details on how to customize things in more detail can be found at http://code.google.com/p/swfobject/w/list
  • 109 Users Found This Useful
Was this answer helpful?

Related Articles

How can I find out what version of Zen Cart or PHP or MySQL I'm using?

To find out what version of Zen Cart or PHP or MySQL you are currently using, you can simply go...

Getting a BLANK PAGE? Here's the answer ...

If you're getting a blank page when trying to browse to a certain page on your store, or after...

What's New in the Upcoming v2.0 release?

Database Abstraction Layer and Sql CacheThe abstraction layer has been re-factored to include a...

Image Preparation - How-to

I've seen several posts where people obviously aren't quite sure about the best way to set up...

Some tips to modify stylesheet

1. Download Web Developer extension for FireFox here2. Install & restart FireFox. You should...