Even though the main flash movie comes in 3 formats, the control player and its skin, if needed, both come as SWF files.
A second way to embed SWF flash video is by making use of Macromedia flash plugin.
However, if you are to embed FLV or MP4 videos, it is not possible to do ‘only’ with SWFObject. You’ll need something more. We will come to this later.
The video tutorial on how to embed the swf, flv, and mp4 files is here. It is thereafter followed by detail instructions including full html code for each case. Readers may be interested to know how to embed video in PowerPoint slide, which incidentally is also not much difficult to do.
Embedding SWF Video – 1
SWFObject is available free, and you can download the latest version from the Google Code site.
The code for embedding a SWF flash video with SWFObject can be as under:
Embedding SWF Video – 2
If you do not prefer using SWFObject, then the code to embed a SWF flash video can be like this:
If you wish, you may include the video parameters like loop, quality, bgcolor, etc. for the SWFObject embedding as well.
Embedding FLV Video
Free Open Source FLV Player
OSFLV is open source embeddable FLV player, and free. Using OSFLV is not difficult.
After you download and unzip the software from the site, go to the code generator page. It’s pretty straight-forward there.
You need to fill up the form for the code to be generated. For my FLV video named ‘example.flv’ of dimension 320×240 pixels and chosen colors of controlbar, I have the code generated as given below.
Notice there are 3 files mentioned in the code. 2 of them – ‘AC_RunActiveContent.js’ and ‘player.swf’ – come with the software you have to download, and then upload to your server. They run the flash video and the control-player respectively.
The third file is the FLV flash video, ‘example.flv’. The above code uses the Macromedia plugin to operate the flash video as in the second example of SWF video above.
Semi-Free JW Player
I use the phrase ‘semi-free’ because LongTail Video’s JW PLayer is free for non-commercial use. For commercial website a license has to be purchased at a reasonable cost. Among other things LongTail Video also provides free and paid player skins that are very useful.
There is a setup wizard at JW Player which is easy to use and like the above free OSFLV player, gives ready-to-embed html code.
Here is a sample code (the portion in blue) I generated for my ‘example.flv’ flash video.
You can set the JW Player so as to make the FLV video run in loop, and not to have any controlbar to control the video. In that case the video will appear just like a looping flash file.
Watch the video below to know how you can do that.
DVDVideoSoft is yet another free tool to run FLV video with controlbar. We may have a video tutorial on this later.
Embedding MP4 Video
MP4 is considered as a vast improvement upon both SWF and FLV formats in terms of quality of the end video and controlling the size.
Nearly all demonstrative videos shown in 2WebVideo website are in MP4, and in fact YouTube too suggests using this format for uploading videos there.
If you are also making videos in MP4 without a control player, you can either display it using one like the JW Player above in the same way as FLV video.
Or, you may upload the video to YouTube or Vimeo, and then use the embed code from there to use in your site. Vimeo for example provides very clean end result, and if you do not want their logo in the embedded video, just think of opting for Vimeo Plus.
June 26, 2010 – Recently, in a symposium, I was asked what is the best and the easiest method to embed video in a webpage. I promptly replied, it is your own or others’ YouTube videos. That set me thinking along the lines I’m going to briefly elaborate now.
Well, YouTube is surely the destination for any web video maker. It’s not only the top video sharing site, it’s also emerging as – would you believe! – a popular search engine. What this means that when you have your video uploaded to YouTube, it has a good possibility of getting more viewers in a short time. This is something not possible for a video with standalone player in your webpage.
When you have your video uploaded to YouTube, you can very easily embed it in your webpage. That makes more sense because of late YouTube’s improved technology renders your video with good viewing. Just ensure that the video you upload to YouTube has a 16:9 resolution so as to avoid black patches on either side of the rendered video.
March 5, 2010 – If you wish to have a flash video player with play/pause/stop controls you may opt for the free edition Flowplayer, arguably one of the best of its type, or the JW Player from LongTail Video. Also, we at 2WebVideo routinely make flash video with video player complete with play/pause/stop controls for our clients. Click here for more.