Skip to content

Poster images in JW FLV player

July 16, 2009

Just a quick blog post for now, to talk briefly about an issue we had recently with the JW FLV player. We were trying to implement poster images (those still frames you see in the player window before you hit “play”, that tease the video contents), and had a problem where the movie wouldn’t play as soon as the image parameter was added.

The implementation code we were using looked like this:

<div id="container">
  <a href="departure.asp?url=">Get the Flash Player</a> to see this player.
<script type="text/javascript" src="/javascript/swfobject.js"></script>
<script type="text/javascript">
  var s1 = new SWFObject("http://support-server/swf/player.swf","ply","615","460","9","#FFFFFF");

(note that I’ve substituted real server names for dummy ones, but the syntax is still accurate)

Ordinarily, you enable poster movies by changing the “flashvars” parameter to include an ‘image’ value – so instead of “file=url-to-movie” you use “file=url-to-movie&image=url-to-image”

When we tried that, however, the player didn’t work. It loaded the chrome for the player, and it loaded the poster image – but you couldn’t get the player to start.

After much weeping, gnashing of teeth, and experimenting, the way we fixed it was to use a local, relative path both to the player.swf file, as well as to the poster image. The final hurdle turned out to be that we were referencing the player.swf file from a central support server, rather than that local web server – so changing this line:

var s1 = new SWFObject("http://support-server/swf/player.swf","ply","615","460","9","#FFFFFF");

to this:

var s1 = new SWFObject("/swf/player.swf","ply","615","460","9","#FFFFFF");

seems to have done the trick. We were unable to change the video location to a relative path, as that file is being served by a central University server – but making the other two files relative was good enough.

You can see the final outcome of all of this on our lecture page – we used Jason Kentner’s lecture as a test case, although we have videos in progress for most of our winter/spring lecture series, “Confluence”.

One Comment leave one →
  1. Dennis Greene permalink
    April 24, 2010 1:00 pm

    Hey thanks for that – I had been wracking my brains and you’ve solved the problem for me. Ta mucho.!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: