iWeb Tip #9 – Flash Video in iWeb (JW Player)

48
15193
Flash Video in iWeb

Flash Video in iWebI’ve had many request asking for a tip on how to get flash video into iWeb.  There are many different ways, but this tutorial is going to show you how to do it with Longtail Video’s JW Player, which is the number one open source media player.   The reason we use flash video is because it’s most compatible with all computers Mac’s and PCs and if your wanting to reach an audience like that it’s the best outlet next to QuickTime and Windows Media Video.  JW player is pretty flexible to customize, but we’re going to make this as simple as possible for you, so here we go:

VIEW DEMO »

Step 1:

Get video you desire to be a flash video and convert it to .flv format if it’s not already.

How do I convert my video to flash video you ask?

Well there are a number of different ways.  You are going to need one of these converter below:

  • Adobe Media Converter (comes with CS4 or Flash Video Encoder from CS3)
  • Visual Hub (no longer in development, but if you got it while it was out, lucky you)
  • Aimersoft Video Converter ($65)
  • Perian QuickTime Plug-In + QuickTime Pro (Perian is free, QuickTime Pro is $29)
  • SoThink FLV Converter ($45)
  • FFMpegX (Free, but it requires some external file installations, they make it a little difficult to get, so here it is made easy by me.  Click here to download the app and here to download the extra files.  Your welcome ;-).  You can get instructions and more info on the software here. After you open the .dmg file and drap application to your app folder and launch the app it will ask you to locate 3 files to add onto it.  They are the ones I provided.  I would recommend moving them to home folder/library/application support/ffmpegx (you’ll make this folder)/put 3 files here that were in the .zip folder here.  Then in the FFMpegX App you’ll know where to find the 3 files to install and they’ll be in a safe place where no one will touch them.  Hope that makes sense.  If it sounds to complex, just go buy one of the other converters above to make life easier for you.)

Which ever converter you use, just convert that video file to a .flv format.  So in a nutshell, step one is convert video to .flv

Step 2:

Download the Longtail Video JW player by clicking here»

You’ll be downloading a .zip file.  Double-click to open and inside you will see 2 files; one called “player.swf” and the other “swfobject.js”.  We will need these files to make this work.  So now we should have a total of three files

  1. Our .flv flash video we converted in step one
  2. player.swf file
  3. swfobject.js file

We just need to do one more thing and we’re ready to roll

Step 3:

We’ll need to have an image that will sit there until the user decides to click play.  So just export out a frame of your video.

It might be easier to go back to your original video to export out the frame.  You can do this in QuickTime pro, iMovie, Final Cut, and many other apps.  Or if you want to make it simple, just play your video, stop it on a frame that you would like to be your hold image and do a screen shot.  You can do a screen shot by pressing “command + shift + 4” on your mac, then draw a box around the frame of video your holding on.  When you let go you’ll have a new .png still frame  on your desktop.  We are going to use this to be the video preview.

You should now have four files.  Fyew.  These are all the files we need and we are ready to roll.  So we should have these four files

  1. Flash Video (our .flv video we converted in step one)
  2. “player.swf” (file we downloaded in step 2)
  3. “swfobject.js” (file we downloaded in step3)
  4. Preview image (file we created in this step.  You should name it preview.png)

For file size reasons you may want to open that image you created in step 3 in the application “Preview” and choose file>save as and save it as a jpeg image and bring the image quality down a bit so that the file loads quickly on the web.  Just a suggestion, if you have photoshop you could choose file>save for web and size it down that way too.  You can use a .png file or a .jpeg file for this

Step 4:

Now put those four files (.flv, .swf, .js,(.png or .jpeg)) onto the server, meaning your iDisk or your own ftp server.  If your using MobileMe I’d recommend making a folder called flash in this location: iDisk/Web/Sites/flash/put 4 files here. Just make sure you have these 4 files on your iDisk or server all all will be well.

Step 5:

Almost done.  All we need to do now is use the below code in an html snippet and replace the items in red with our own server path names.


<script type="text/javascript"
src="https://web.me.com/yourusername/flash/swfobject.js"></script>
<div id="player">This text will be replaced</div>
<script type="text/javascript">
var so = new SWFObject('https://web.me.com/yourusername/flash/player.swf','mpl','720','480','9');
so.addParam('allowscriptaccess','always');
so.addParam('allowfullscreen','true');
so.addParam('flashvars','&file=https://web.me.com/yourusername/flash/yourflashfile.flv&image=https://web.me.com/yourusername/flash/yourimage.jpg&stretching=none');
so.write('player');
</script>

Just replace the items in red with the path that goes to your files on the iDisk replacing the appropriate names to point to the right place.  So be sure to put in your MobileMe username and your correct flash video name (yourflashvideo.flv) and your preview image (myimage.jpeg or myimage.png).  Also be sure to adjust the width and height of your video with the 2 numbers that are red in the code.  Once it’s all updated and you have all your links pointing to the right spot, hit “apply”.

Done!

We now have flash video in iWeb successfully! Yay!

Hope it wasn’t too complicated for ya.  Just do it a couple times and you’ll have it down in no time.  There is a video I made that will walk you through this too if you’d rather look at that.  Just got the Video Tutorials section and it’s all about flash video.

Note: You can use Longtail Video JW Player on your site for free as long as your not selling anything, have ads on your site, etc.  If you are doing those things you need to purchase a license.  It’s €30 (Euro) which is about $41 dollars.  You can purchase a license here»

More Notes:

If your wanting to customize the JW player, they have a nifty little embed code creator that you can tell it what paramaters you want to be set.  Click here to go to it.

48 comments

  1. funnel 21 February, 2010 at 16:35 Reply

    I haven’t been able to get this to work – all I get is a text box that says “This text will be replaced”. It makes no difference when publishing the site to Mobileme – the webpage has the same box. I am hosting the files on Mobileme and have file sharing turned on for them. I think a few others have found similar problems. Have you any ideas as to what I am doing wrong… or whether updates to iWeb have gotten in the way.

  2. JS 26 February, 2010 at 06:31 Reply

    Step 5 code appears to be wrong on new site. No text in red and the one of the last lines (starts with so.addParam) appears to be cutoff at the end. Great video btw.

  3. funnel 27 February, 2010 at 06:21 Reply

    Beats me. Still all I get is “This text will be replaced”. Here is the snippet: by all means check out the links.

    This text will be replaced

    var so = new SWFObject(‘http://web.me.com/jodeverill/flash/player.swf’,’mpl’,’480,’270′,’9′);
    so.addParam(‘allowscriptaccess’,’always’);
    so.addParam(‘allowfullscreen’,’true’);
    so.addParam(‘flashvars’,’&file=http://web.me.com/jodeverill/flash/iht.flv&image=http://web.me.com/jodeverill/flash/iht.jpg&stretching=none’);
    so.write(‘player’);

  4. funnel 27 February, 2010 at 06:27 Reply

    Oops – the snippet went a bit out of shape when I posted it above, must be an HTML thing. Anyway, I copied it verbatim from the tip above into iWeb and the files are on my iDisk in the Web/Sites folder, exactly as in the video tutorial. It still doesn’t work. Any ideas would be greatly appreciated.

  5. funnel 28 February, 2010 at 05:42 Reply

    Apologies – I have spotted my error: I lost a quotation mark in the copy and paste process. All works now – many thanks.

  6. CosmicBabs 3 March, 2010 at 14:55 Reply

    hey! great site! … I’ve been working on doing a webpage with info on how to help Chile for its recovery after the earthquake and I wanted to have an flv video in it and your page and tutorials gave me all the info I needed to accomplish that … THANKS!!!

  7. fin 7 March, 2010 at 18:51 Reply

    Hi, First thanks so much for a great site! My problem is my website is hosted by go daddy. Trying to get this flash video for the first page of my site. Pretty much got through all the steps but still get the “this text will be replaced” message instead of the video. My confusion is what to enter here: http://web.me.com/yourusername/flash/swfobject.js ???
    Do I enter my website name and my username on go daddy? Sorry to be such a simpleton, but I know I’m real close. thanks for any help.
    fin

  8. Eternal Polk 12 March, 2010 at 03:39 Reply

    Hi. I got this to work with jwplayer, but when I try using Flash all I get is the player with the bar showing it’s trying to load the video. I tested the html and it plays when I double click it and in Coda it operates fine but when I load it on the server it has problems and won’t show up in iWeb. I did a local test and removed the FLV file on my drive from the folder it was in with the html file and I got the same problem…the player searching for the source FLV file. Can you help solve this as I really want to use the flash player

  9. Tim 14 March, 2010 at 16:01 Reply

    If I am using godaddy’s ftp to upload, where do I put those four files; and…
    where do I find this file names to replace the code? I am a newbie so I need a bit more help…

    Thank you!

  10. GH23 19 March, 2010 at 12:59 Reply

    This video is fantastic, however, like a few others here, I’m having a problem getting the flash video to appear, and I think it’s because I am using a server for my sites (Media Temple). When I upload the videos via Transmit, I have a username and password, so would think that this info would need to be included in this html? This is what I posted in the html snippet:

    This text will be replaced

    var so = new SWFObject(‘http://mototvnetwork.com/flash/player.swf’,’mpl’,’720′,’486′,’9′);
    so.addParam(‘allowscriptaccess’,’always’);
    so.addParam(‘allowfullscreen’,’true’);
    so.addParam(‘flashvars’,’&file=http://mototvnetwork.com/flash/DucatiTVSample.flv&image=http://mototvnetwork.com/flash/DucatiTVSample.jpg&stretching=none’);
    so.write(‘player’);

    Any help would be greatly appreciated, and perhaps there could be a section on this great site to inform people such as us with rented servers.

    Thanks again

  11. agostino 20 March, 2010 at 07:20 Reply

    Thanks for your help
    I put my photofilms by IWEB inside my site, I change Quick time (mov) to FLASH (flv) by encoding with ffmpegx at the dimention 640×352 but on the page the image appear smaller (also when I make prewiew on Iweb – the window with the blue frame appear with the rights dimention but the movie smaller) also the picture aa.jpg doesn’t appear
    so what is wrong?
    this is the code:

    This text will be replaced

    var so = new SWFObject(‘http://web.me.com/amidejulien/player/player.swf’,’mpl’,’640′,’352′,’9′);
    so.addParam(‘allowscriptaccess’,’always’);
    so.addParam(‘allowfullscreen’,’true’);
    so.addParam(‘flashvars’,’&file=http://web.me.com/amidejulien/player/aaaa.flv&image=http://web.me.com/yourusername/flash/aa.jpg&stretching=none’);
    so.write(‘player’);

    Thanks
    Agostino

  12. Adrian Mac 31 March, 2010 at 03:51 Reply

    Hi guys

    I have built a site using iWeb and then I “publish” it to my desktop to check everything is working fine before uploading everything to my FTP server using Fetch.

    Given this method of working is there a way I can adapt your cut and paste HTML code so that I can put the flash elements in my website folder on my desktop and check everything is going to work when I upload..?

    thanks

    Adrian

  13. Jordan 8 April, 2010 at 10:01 Reply

    UG…. what am i doing wrong here…. all i get it “this text will be replaced”. I have a deadline and ANY help would be greatly appreciated. =) Thanks

    This text will be replaced

    var so = new SWFObject(‘../flash/player.swf’,’mpl’,’686′,’158′,’9′);
    so.addParam(‘allowfullscreen’,’true’);
    so.addParam(‘allowscriptaccess’,’always’);
    so.addParam(‘wmode’,’opaque’);
    so.addVariable(‘file’,’../flash/introflash.flv’);
    so.addVariable(‘frontcolor’,’FFFFFF’);
    so.addVariable(‘lightcolor’,’FFFFFF’);
    so.addVariable(‘screencolor’,’FFFFFF’);
    so.addVariable(‘controlbar’,’none’);
    so.addVariable(‘autostart’,’true’);
    so.addVariable(‘repeat’,’always’);
    so.addVariable(‘stretching’,’exactfit’);
    so.write(‘mediaspace’);

  14. Adam 20 April, 2010 at 08:56 Reply

    Hi Jordon,

    If you wish to add these elements into your flash video HTML code, you have to insert them into the following section of code.

    so.addParam(‘flashvars’,’&file=http://web.me.com/yourusername/flash/yourflashfile.flv&image=http://web.me.com/yourusername/flash/yourimage.jpg&stretching=none’);

    Here’s an example:

    so.addParam(‘flashvars’,’&file=http://web.me.com/yourusername/flash/yourflash.flv&image=http://web.me.com/yourusername/flash/yourimage.jpg&stretching=none&controlbar=none&autostart=true&repeat=always&border=#FFFFFF&background=#FFFFFF’);

    Hope this helps

  15. Sheena 7 June, 2010 at 02:41 Reply

    Hi,

    Thanks for this. You are a life saver for someone like me!!! I have pretty much got the flash video to work, just one slight problem: the actual video is not refitting the size of the flash player – so you can only see about a quarter of the video in the flash player. can you help? is there a way around this?

    Thanks again – you’re website is fantastic!!!!

  16. Matt 27 August, 2010 at 21:21 Reply

    I got almost everything to work, except when I click play, it shows a dark screen and says it can’t find my FLV file, I know it’s there, it all shows up in the preview etc……any thoughts?

Leave a reply

Facebook
Twitter
YouTube