Answers Search Help
Boston University home page
 
    Overview
 
 
 
    Getting Started
 
 
    Creating Components
 
 
 
 
 
 
 
    Advanced Topics
 
 
 
    Also See
   
   
   

Embedding your video using SWFObject

Because of Internet Exporer's reduced support for the <object> and <embed> tag, we recommend that you embed your streaming Flash video in your page using Geoff Stearns' SWFObject method instead. Geoff Stearns has co-authored several books on the topic of Flash Development and has contributed an article on SWFObject to Adobe's Developer Center.

Using SWFObject is easy. We've put together a code-building tool to generate the code you need.

Steps

  1. Unless you created the required SWF file(s) using Dreamweaver 8 or using Flash Professional 8, download the files named nis-movie.swf and nis-flv-skin.swf from the following links. (Right-click on the filenames to download, or for Mac, click and hold):

      nis-movie.swf

      nis-flv-skin.swf

  2. Upload your SWF file(s) to the same directory as your Web page that will display the video
  3. Paste this into the <head> section of the page:

    <script type="text/javascript" src="http://www.bu.edu/webcentral/common/swfobject.js"></script>

  4. Fill out the code builder below to generate your code for embedding the video.
  5. Copy the resulting code from the code builder and paste it into your page where you want your video to appear.
  6. Upload your Web page and test, and you're done! (If you have problems, try our troubleshooting page.)

Upload your Web page and test, and you're done! (If you have problems, try our troubleshooting page.)

Code Generator

Fill out this form to generate the code you will paste into your page, as described in the steps above.

Application name:  


You receive the application name by e-mail when you register your streaming Flash directory.

 

Instance name:  


The name of any subdirectory of your registered Flash directory which holds your FLV files.

 

Stream name:  


The filename of your FLV file without its .flv extension.

 

Playback SWF:  


The filename of the SWF file that negotiates the stream with the Flash Media Server (you can use our generic SWF file).

 

Skin SWF :  


Leave empty if your player skin is integrated with your playback SWF into a single SWF file. Otherwise, you can use any player skin file, including our generic SWF player skin.

(Note: If your player skin is integrated with with your playback SWF, this code builder assumes your application name, instance name, and stream name are also coded into your playback SWF) .

Width:  


Video width (in pixels) plus width needed for your player skin. For our generic skin, use 342.

 

Height:  


Video height (in pixels) plus height needed for your player skin. For our generic skin, use 291.

 

Buffer Time:  


Time in seconds to buffer before playback. Recommendation is zero.

 

Autoplay:

 

Auto-rewind:  
Determines whether player displays on first or last frame of video after completing playback.

 

Flash Player Version:  
Flash 7 has slightly greater distribution (95+% compared to ~92% in the U.S.), while Flash 8 better quality.

 

Message for getting
Flash Player:
 
You can include images, code for Google to index, or any other HTML content in the message that appears when users lack the required Flash player.

 

   

Code You Use

After completing the code builder form, above, use the resulting code below to paste into your Web page where you want your video to appear.

Code appears here when you complete the code builder form

WebCentral Using Publishing Learning Training Consulting WebCentral
Answers Search Help
NIS  |  OIT  |  Boston University  |   May 12, 2009