Embed SWF in Your Web Page


flip camera

One of the easiest and quickest ways to display videos on your website is to upload it to YouTube then embed the code they provide into the html code of your website. Some of the problems associated with using YouTube are:

  • lack of video quality
  • lack of control
  • Google is free to use your content however they wish
  • Unrelated videos are displayed after yours
  • Length of video restricted

If you want to avoid all these problems consider embedding a flash video file (.swf) in your web page. Most computers already have the flash player installed so it will play automatically. You can also include code within your html to automatically download the flash player if the computer doesn’t have it installed.

There are 2 flash video formats .SWF and .FLV. Since we are discussing how to embed SWF in your web page I’ll describe SWF.

What is SWF?

A .swf file includes both audio and video. It works best for progressive downloading. This means a portion of the file will play as soon as it’s downloaded. The viewer will need to wait until all the other portions are downloaded. Usually this is not a problem with high connection speeds unless it is a very large file.

Convert your video to an .SWF file

When you first shoot your video it will not be in the SWF format therefore you need to convert it. Use the free online converter…youconvertit.com/. These are some of the formats it supports:

AVI – Windows video file
FLV – Flash Video
MOV – Apple QuickTime Movie
MP3 – Compressed audio file
MP4 – MPEG-4 Video File
MPEG – Video File
MPG – Moving Picture Experts Group File
RM – RealMedia Streaming Media
SWF – Macromedia Flash Format File
WAV – Windows audio file
WMA – Windows media file
WMV – Windows Media Video

How to embed SWF (flash files) in your web page

Copy and paste the code below into the html of your web page. Remember to replace video.swf with your own file name and make sure you use the correct file path otherwise it won’t play. For example if you place the swf file in a folder named flash the file path will be flash/video.swf. You can also adjust the video frame size to your own preferences.


<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,16,0"
width="320" height="400" >
<param name="movie" value="video.swf">
<param name="quality" value="high">
<param name="play" value="true">
<param name="LOOP" value="false">
<embed src="video.swf" width="320" height="400" play="true" loop="false" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer"
type="application/x-shockwave-flash">
</embed>
</object>

Explanation of parameters

object and embed
use “true” (yes) or “false” (no) for these parameters.

classid
This tells the browser what file type to load and what application to use to load it into the browser. Copy the code exactly as shown.

codebase
This tells the browser where to find the Flash player plugin program if it is not already installed. If it is not, it will install automatically if the user allows it to (the browser will ask the user if he wants to install the browser plugin, and the user agrees to). Copy the code exactly as shown.

width and height
Use the width and height of the actual video file. If you wish to change the dimensions make sure they are proportionate so the video won’t look distorted.

param name=”movie” value
This is the location of your video file on the server. It can be a relative URL (ie video.swf) or the full URL (ie http://www.domainname.com/video.swf).

param name=”quality” value

There are 6 different settings for this feature: “low”, “autolow”, “autohigh”, “medium”, “high”, and “best”.

  • “low” – the videoplayer will favor the playback speed of the video clip and will never use anti-aliasing.
  • “autolow” – the player will emphasis the speed at first but then will improve the appearance whenever possible. Playback will begin with anti-aliasing turned off at first but if it detects that the processor can handle it, the anti-aliasing will be turned on.
  • “autohigh” – the player will equally emphasize playback speed and appearance at the start, but will favor playback speed over appearance if it is necessary. Anti-aliasing is turned on at first, but will be turned off if the actual frame rate drops below the specified frame rate to enhance playback speed. To imitate the “View > Antialias” setting in Flash, use this setting.
  • “medium” – the player will apply some anti-aliasing, but will not smooth bitmaps. The quality of this setting is better than the “low” setting, but will not be as good as the “high” setting.
  • “high” – the player will favor the appearance over the playback speed and anti-aliasing will always be applied. As long as the clip does not contain any animation, the bitmaps will be smoothed.
  • “best” – the player will display the best quality possible and will not concern itself with video playback speed. The entire clip will be anti-aliased, and all bitmaps will be smoothed.

Source: http://www.free-video-hosting.net/embed-flash.php

param name=”play” value
If set to “false”, the movie clip will not play immediately when loaded in the browser. You need to click to begin the video playback.The default value is “true” if this attribute is omitted.

param name=”loop” value
If set to “false”, the movie will stop when it reaches the end. If set to “true”, it will play indefinitely (looping continuously until it is stopped manually or the webpage is closed). The default value is “true” if this attribute is omitted.

embed src
The tag is a duplicate of the tag, but is needed to function with just about all other browsers other then Windows IE (such as Mozilla FireFox). All the parameters for both tags (embed src=”….swf”, width=”…”, height=”…”, play=”…”, loop=”…”, and quality=”high”) are the same.

pluginspage
This tells the browser where to find Flash Player if it ‘s not already installed on the user’s computer. It will install automatically if the user gives permission.

Action step
Copy and paste the html code above into your web page (replace video.swf with your own file) then upload both the swf file and web page to your server. When you enter the web page URL in your browser you’ll be able to view the video.

Related articles
How to create a flash slide show

And now I would like to invite you to claim your FREE report titled:
7 Habits of Highly Effective Traffic Generation

Herman Drost is the owner and author of
http://www.DrostDesigns.com
Web Design, SEO, Article Marketing

Comments

  1. Great info you have here. You genuinely comprehend this and I am glad I found this post by you thanks a bunch.

  2. I sometimes write the code in HTML, it works the same way. But seldom would it fit all browsers well.
    I still wonder if there is a perfect html code to embed flash in webpage.

  3. Hey! This is my first comment here so I just wanted to give a
    quick shout out and say I really enjoy reading through your posts.

    Can you recommend any other blogs/websites/forums that cover the same subjects?
    Thanks for your time!

Trackbacks

  1. […] last article described how to embed SWF in your web page. The main problem associated with this is that the flash video plays automatically. If the video is […]

  2. Website Design…

    […]Embed SWF in Your Web Page[…]…

Leave a Reply to Website Design Cancel reply

*