How To Embed SWF, FLV, MP4 Flash Video In Your Web Page

85

By words2content

Ever since flash video became the accepted medium to show web video in websites mainly because of smaller size – and therefore faster download – and lesser distortion, the web has seen a big rush of it. The increase in popularity of video sharing sites like Hulu, YouTube, and others bears testimony to that.

While it is easy to embed YouTube video in any website, in this article I will shift the focus a little and deal on how you can embed flash video in your web page independent of any video sharing host.

I will separately talk about embedding SWF, FLV and the now-in-vogue MP4 flash videos. Viewers may keep in mind that no flash video can or must be made in one common format for the fear of abnormal file size and/or distortion in the end product.

Thus, while SWF is good for short, low-motion flash video, FLV and MP4 should be the choice for longer, full-motion screen videos.


Embedding SWF Video

There are 2 ways to embed SWF flash video in a web page – SWFObject and Macromedia plugin. SWFObject is available free for download from Google Code page.

The html codes for both SWFObject and Macromedia plugin are as below. The full html code for embedding SWF video in web page is available here.


Code: SWF With SWFObject.JS

<script type="text/javascript" src="swfobject.js"></script>
<object width="400" height="300">
<param name="movie" value="example.swf">
<embed src="example.swf" width="400" height="300">
</embed>
</object>

Code: SWF with Macromedia Plugin

<object id="whatever" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="400" height="300" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,115,0">
<param name="src" value="example.swf"/>
<param name="bgcolor" value="#FFFFFF"/>
<param name="quality" value="best"/>
<embed name="whatever" src="example.swf" width="400" height="300" bgcolor="#FFFFFF" quality="best" pluginspage="http://www.adobe.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed>
</object>

Embedding FLV Video Using Free FLV Player

Usually, an FLV flash format is ideal for videos of longer duration having high motion in them. Camera movie is nearly always shown as FLV video in a web page, and now increasingly as MP4 video as well.

Open Source FLV player, OSFLV, is available free to embed FLV video in a web page with controls that can play/pause/stop the video.

After you download and unzip the software from the site, go to the code generator page, and fill in the form that automatically generates the necessary html code for you.

Embedding FLV & MP4 Video With JW Player

JW Player is versatile and free for non-commercial website. With JW Player you can have a FLV/MP4 flash video running in a loop without any play/pause/stop controls giving the impression of a video advertisement running.

Or, you can have various types of controls, various types of player skins, and so much more. What’s really good with JW Player is that the setup wizard [http://www.longtailvideo.com/support/jw-player-setup-wizard] lets you do all these very easily.

You can then view how the video actually plays, and if you like it, you can copy the html code given by up wizard the set for embedding the player in your webpage.

The video below explains the different ways of embedding flash movies in web page. Full html codes and other details can be had from this article on embedding SWF, FLV, & MP4 videos in a web page.

Comments

Sweet chilD profile image

Sweet chilD 2 years ago

It is a great tutorial. There is also other way to do so. Check playerdiy.com, with it, not only you can easily add flash videos to web page, but also can make customized flash video player for your website - http://www.playerdiy.com/

words2content profile image

words2content Hub Author 2 years ago

Thanks, Sweet chilD.

karfes 2 years ago

does it mean that after embedding the swf video on the site the user wont have to install the plugin on his browser to view the movie. is the plugin automatically installed on the users browser or wat?

Sweet chilD profile image

Sweet chilD 2 years ago

Adobe Flash Player browser plugin is always needed to view Flash via web browser.

You have to first install the plugin on your browser and then embed swf to web page.

techbt 2 years ago

Nice post am looking for it.I have one query can link flv files from any other web server or should be in the same server where the site is hosted?

joe 2 years ago

Thanks, however, I still can't figure out how to embed a .swf file so that there are some controls the user can use, like a play button, stop, and skip around in the movie? Typical embed lets the user watch but gives them no control...

Arun 2 years ago

Joe,

Am also suffering from same trouble, please anyone come out with solution for playing swf file with controls like play,pause,volume and full screen.

Thanks in advance

panamadany 2 years ago

Great! Doremisoft video to flash converter is also a good choice. http://www.doremisoft.net/Video-to-Flash-Converter

words2content profile image

words2content Hub Author 2 years ago

Sorry friends, I didn't check up for quite awhile. Let me answer some of the queries here.

@techbt, yes flv files can be from other server. As long as the URLs are correct (the path to the different files), it should work.

@joe, @Arun, having play/pause/stop controls is in addition to the embedded flash video. Flowplayer [http://flowplayer.org/download/index.html] is one of the best free/paid flash video player. JW Player [http://www.longtailvideo.com/players/jw-flv-player] is another great paid flash video player.

We at 2WebVideo [http://www.2webvideo.com/hire/] routinely provide the service of flash video with video player to our clients.

Hope this helps.

Flv Player 2 years ago

I need to know how flv is embedded in SWF files.That is,if I have to parse the swf file,what should i look for to figure out if flv is embedded in Swf or not.

Flash video websites 22 months ago

This is good an informative. Embedding flash on your sites is great for capturing user attention longer and making your site more interactive. Keep it up!

words2content profile image

words2content Hub Author 21 months ago

Thank you.

Zankar 21 months ago

Open source flash player is really a good option. This tutorial did a good job leading to this link.

Also if you can put example.swf over here to be downloaded it will be very easy and handy

Chetan 21 months ago

teri ____ me _____

Enzo 20 months ago

Is there is a WYSIYG solution? I can never get JW or Flowplayer to work right, what with the XML files you have to create and debug, etc.

orkut scraps 20 months ago

i want to create a full page view flash website,which is the ratio of swf file ?

randa 17 months ago

tenx for sharing..... that's importantn to me coz i want to show flash on my site..... keep sharing bro.....

Doraemon The Movie 16 months ago

This was the one who has long been my search, thank you very much for the information ...

haq nawaz 15 months ago

I admit Google is No.1 search engine of the internet world. I always take help of Google to get any more information about latest news. I'm glad that Google Global will be useful to so many.

antonette 14 months ago

good

nidhi 6 months ago

i want to embed video in .net application. i used the following code :

embed height="400" width="600" flashvars="http://localhost/RahimGreen/Videos/YouTube - Aamir Khan's next project.flv\" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent" type="application/x-shockwave-flash" src=="localhost/RahimGreen/VideoPlayer/mediaplayer.swf". Video and swf player i have included in my project.But the page stucks in Postback.what could be the problem.Please suggest someone..

http://www.youtube.com/watch?v=U90_ZZMavKg 5 months ago

http://www.youtube.com/watch?v=U90_ZZMavKg

not working 4 months ago

http://www.jandwtreeservice.com Embed video isnt working

jagdish 2 months ago

hey,

how to add flv video in xml file of flash.

john 10 days ago

One of the most easy ways to embed FLV video into your HTML page is to use the video services like YouTube, Vimeo etc. In other words you need to upload your video to the video service and then use the share button and copy the embed code.

http://www.hdwebplayer.com

Submit a Comment
Members and Guests

Sign in or sign up and post using a hubpages account.



    • No HTML is allowed in comments, but URLs will be hyperlinked
    • Comments are not for promoting your Hubs or other sites

    Please wait working